Package com.tangosol.io.pof
Class PofOutputStream
java.lang.Object
java.io.OutputStream
com.tangosol.io.pof.PofOutputStream
- All Implemented Interfaces:
com.oracle.coherence.common.io.OutputStreaming,OutputStreaming,Closeable,DataOutput,Flushable,ObjectOutput,AutoCloseable
public class PofOutputStream
extends OutputStream
implements OutputStreaming, DataOutput, ObjectOutput
An ObjectOutput implementation suitable for writing Externalizable and
ExternalizableLite objects to a POF stream, although without support for
schema evolution and other advanced POF features.
- Author:
- cp 2006.07.29
-
Constructor Summary
ConstructorsConstructorDescriptionPofOutputStream(PofWriter out) Construct a PofOutputStream that will write its information to an underlyingPofWriter. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this OutputStream and releases any associated system resources.voidflush()Flushes this OutputStream and forces any buffered output bytes to be written.Obtain the underlying PofWriter.intDetermine the next property index to write to.voidwrite(byte[] ab) Writes all the bytes in the arrayab.voidwrite(byte[] ab, int of, int cb) Writescbbytes starting at offsetoffrom the arrayab.voidwrite(int b) Writes the eight low-order bits of the argumentb.voidwriteBoolean(boolean f) Writes the boolean valuef.voidwriteByte(int b) Writes the eight low-order bits of the argumentb.voidwriteBytes(String s) Writes the Strings, but only the low-order byte from each character of the String is written.voidwriteChar(int ch) Writes a char value, comprised of the 16 low-order bits of the argumentch; the 16 high-order bits ofchare ignored.voidwriteChars(String s) Writes the Stringsas a sequence of characters.voidwriteDouble(double dfl) Writes a double value.voidwriteFloat(float fl) Writes a float value.voidwriteInt(int n) Writes an int value.voidwriteLong(long l) Writes a long value.voidWrites the Objectoso that the correspondingObjectInput.readObject()method can reconstitute an Object from the written data.voidwriteShort(int n) Writes a short value, comprised of the 16 low-order bits of the argumentn; the 16 high-order bits ofnare ignored.voidWrites the Stringsas a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the correspondingDataInput.readUTF()method can reconstitute a String from the written data.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
Method Details
-
write
Writes the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Specified by:
writein classOutputStream- Parameters:
b- the byte to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
write
Writes all the bytes in the arrayab.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classOutputStream- Parameters:
ab- the byte array to write- Throws:
IOException- if an I/O error occursNullPointerException- ifabisnull
-
write
Writescbbytes starting at offsetoffrom the arrayab.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classOutputStream- Parameters:
ab- the byte array to write fromof- the offset intoabto start writing fromcb- the number of bytes fromabto write- Throws:
IOException- if an I/O error occursNullPointerException- ifabisnullIndexOutOfBoundsException- ifofis negative, orcbis negative, orof+cbis greater thanab.length
-
flush
Flushes this OutputStream and forces any buffered output bytes to be written.- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Specified by:
flushin interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
flushin classOutputStream- Throws:
IOException- if an I/O error occurs
-
close
Closes this OutputStream and releases any associated system resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Specified by:
closein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
closein classOutputStream- Throws:
IOException- if an I/O error occurs
-
writeBoolean
Writes the boolean valuef.- Specified by:
writeBooleanin interfaceDataOutput- Parameters:
f- the boolean to be written- Throws:
IOException- if an I/O error occurs
-
writeByte
Writes the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writeBytein interfaceDataOutput- Parameters:
b- the byte to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeShort
Writes a short value, comprised of the 16 low-order bits of the argumentn; the 16 high-order bits ofnare ignored.- Specified by:
writeShortin interfaceDataOutput- Parameters:
n- the short to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeChar
Writes a char value, comprised of the 16 low-order bits of the argumentch; the 16 high-order bits ofchare ignored.- Specified by:
writeCharin interfaceDataOutput- Parameters:
ch- the char to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeInt
Writes an int value.- Specified by:
writeIntin interfaceDataOutput- Parameters:
n- the int to write- Throws:
IOException- if an I/O error occurs
-
writeLong
Writes a long value.- Specified by:
writeLongin interfaceDataOutput- Parameters:
l- the long to write- Throws:
IOException- if an I/O error occurs
-
writeFloat
Writes a float value.- Specified by:
writeFloatin interfaceDataOutput- Parameters:
fl- the float to write- Throws:
IOException- if an I/O error occurs
-
writeDouble
Writes a double value.- Specified by:
writeDoublein interfaceDataOutput- Parameters:
dfl- the double to write- Throws:
IOException- if an I/O error occurs
-
writeBytes
Writes the Strings, but only the low-order byte from each character of the String is written.- Specified by:
writeBytesin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
writeChars
Writes the Stringsas a sequence of characters.- Specified by:
writeCharsin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
writeUTF
Writes the Stringsas a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the correspondingDataInput.readUTF()method can reconstitute a String from the written data.- Specified by:
writeUTFin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
writeObject
Writes the Objectoso that the correspondingObjectInput.readObject()method can reconstitute an Object from the written data.- Specified by:
writeObjectin interfaceObjectOutput- Parameters:
o- the Object to write- Throws:
IOException- if an I/O error occurs
-
getPofWriter
Obtain the underlying PofWriter.- Returns:
- the PofWriter
-
nextIndex
public int nextIndex()Determine the next property index to write to.- Returns:
- the next property index to write to
-