public class PofOutputStream extends OutputStream implements OutputStreaming, DataOutput, ObjectOutput
| Constructor and Description |
|---|
PofOutputStream(PofWriter out)
Construct a PofOutputStream that will write its information to an underlying
PofWriter. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this OutputStream and releases any associated system resources.
|
void |
flush()
Flushes this OutputStream and forces any buffered output bytes to be written.
|
PofWriter |
getPofWriter()
Obtain the underlying PofWriter.
|
int |
nextIndex()
Determine the next property index to write to.
|
void |
write(byte[] ab)
Writes all the bytes in the array
ab. |
void |
write(byte[] ab, int of, int cb)
Writes
cb bytes starting at offset of from the array ab. |
void |
write(int b)
Writes the eight low-order bits of the argument
b. |
void |
writeBoolean(boolean f)
Writes the boolean value
f. |
void |
writeByte(int b)
Writes the eight low-order bits of the argument
b. |
void |
writeBytes(String s)
Writes the String
s, but only the low-order byte from each character of the String is written. |
void |
writeChar(int ch)
Writes a char value, comprised of the 16 low-order bits of the argument
ch; the 16 high-order bits of ch are ignored. |
void |
writeChars(String s)
Writes the String
s as a sequence of characters. |
void |
writeDouble(double dfl)
Writes a double value.
|
void |
writeFloat(float fl)
Writes a float value.
|
void |
writeInt(int n)
Writes an int value.
|
void |
writeLong(long l)
Writes a long value.
|
void |
writeObject(Object o)
Writes the Object
o so that the corresponding ObjectInput.readObject() method can reconstitute an Object from the written data. |
void |
writeShort(int n)
Writes a short value, comprised of the 16 low-order bits of the argument
n; the 16 high-order bits of n are ignored. |
void |
writeUTF(String s)
Writes the String
s as a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the corresponding DataInput.readUTF() method can reconstitute a String from the written data. |
public void write(int b)
throws IOException
b. The 24 high-order bits of b are ignored.write in interface com.oracle.common.io.OutputStreamingwrite in interface DataOutputwrite in interface ObjectOutputwrite in class OutputStreamb - the byte to write (passed as an integer)IOException - if an I/O error occurs
public void write(byte[] ab)
throws IOException
ab.write in interface com.oracle.common.io.OutputStreamingwrite in interface DataOutputwrite in interface ObjectOutputwrite in class OutputStreamab - the byte array to writeIOException - if an I/O error occursNullPointerException - if ab is null
public void write(byte[] ab,
int of,
int cb)
throws IOException
cb bytes starting at offset of from the array ab.write in interface com.oracle.common.io.OutputStreamingwrite in interface DataOutputwrite in interface ObjectOutputwrite in class OutputStreamab - the byte array to write fromof - the offset into ab to start writing fromcb - the number of bytes from ab to writeIOException - if an I/O error occursNullPointerException - if ab is nullIndexOutOfBoundsException - if of is negative, or cb is negative, or of+cb is greater than ab.length
public void flush()
throws IOException
flush in interface com.oracle.common.io.OutputStreamingflush in interface Flushableflush in interface ObjectOutputflush in class OutputStreamIOException - if an I/O error occurs
public void close()
throws IOException
close in interface com.oracle.common.io.OutputStreamingclose in interface Closeableclose in interface ObjectOutputclose in interface AutoCloseableclose in class OutputStreamIOException - if an I/O error occurs
public void writeBoolean(boolean f)
throws IOException
f.writeBoolean in interface DataOutputf - the boolean to be writtenIOException - if an I/O error occurs
public void writeByte(int b)
throws IOException
b. The 24 high-order bits of b are ignored.writeByte in interface DataOutputb - the byte to write (passed as an integer)IOException - if an I/O error occurs
public void writeShort(int n)
throws IOException
n; the 16 high-order bits of n are ignored.writeShort in interface DataOutputn - the short to write (passed as an integer)IOException - if an I/O error occurs
public void writeChar(int ch)
throws IOException
ch; the 16 high-order bits of ch are ignored.writeChar in interface DataOutputch - the char to write (passed as an integer)IOException - if an I/O error occurs
public void writeInt(int n)
throws IOException
writeInt in interface DataOutputn - the int to writeIOException - if an I/O error occurs
public void writeLong(long l)
throws IOException
writeLong in interface DataOutputl - the long to writeIOException - if an I/O error occurs
public void writeFloat(float fl)
throws IOException
writeFloat in interface DataOutputfl - the float to writeIOException - if an I/O error occurs
public void writeDouble(double dfl)
throws IOException
writeDouble in interface DataOutputdfl - the double to writeIOException - if an I/O error occurspublic void writeBytes(String s) throws IOException
s, but only the low-order byte from each character of the String is written.writeBytes in interface DataOutputs - the String to writeIOException - if an I/O error occursNullPointerException - if s is nullpublic void writeChars(String s) throws IOException
s as a sequence of characters.writeChars in interface DataOutputs - the String to writeIOException - if an I/O error occursNullPointerException - if s is nullpublic void writeUTF(String s) throws IOException
s as a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the corresponding DataInput.readUTF() method can reconstitute a String from the written data.writeUTF in interface DataOutputs - the String to writeIOException - if an I/O error occursNullPointerException - if s is nullpublic void writeObject(Object o) throws IOException
o so that the corresponding ObjectInput.readObject() method can reconstitute an Object from the written data.writeObject in interface ObjectOutputo - the Object to writeIOException - if an I/O error occurspublic PofWriter getPofWriter()
public int nextIndex()