|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.io.ByteSerializationOutputStream
ibis.io.DataSerializationOutputStream
public class DataSerializationOutputStream
This is the SerializationOutputStream
version that is used
for data serialization. With data serialization, you can only write
basic types and arrays of basic types. It also serves as a base type
for Ibis serialization.
Constructor Summary | |
---|---|
DataSerializationOutputStream(DataOutputStream out)
Constructor with a DataOutputStream . |
Method Summary | |
---|---|
void |
close()
Flushes and closes this stream, and flushes the underlying streams. |
void |
flush()
Flushes everything collected sofar. |
void |
internalWriteByteBuffer(ByteBuffer value)
|
String |
serializationImplName()
Returns the actual implementation used by this output. |
void |
statistics()
Print some statistics. |
void |
writeArray(boolean[] ref,
int off,
int len)
Writes (a slice of) an array of booleans. |
void |
writeArray(byte[] ref,
int off,
int len)
Writes (a slice of) an array of bytes. |
void |
writeArray(char[] ref,
int off,
int len)
Writes (a slice of) an array of characters. |
void |
writeArray(double[] ref,
int off,
int len)
Writes (a slice of) an array of doubles. |
void |
writeArray(float[] ref,
int off,
int len)
Writes (a slice of) an array of floats. |
void |
writeArray(int[] ref,
int off,
int len)
Writes (a slice of) an array of integers. |
void |
writeArray(long[] ref,
int off,
int len)
Writes (a slice of) an array of longs. |
void |
writeArray(short[] ref,
int off,
int len)
Writes (a slice of) an array of shorts. |
void |
writeArrayBoolean(boolean[] ref,
int offset,
int len)
Method to put a boolean array in the "array cache". |
void |
writeArrayByte(byte[] ref,
int offset,
int len)
Method to put a byte array in the "array cache". |
void |
writeArrayChar(char[] ref,
int offset,
int len)
Method to put a char array in the "array cache". |
void |
writeArrayDouble(double[] ref,
int offset,
int len)
Method to put a double array in the "array cache". |
void |
writeArrayFloat(float[] ref,
int offset,
int len)
Method to put a float array in the "array cache". |
void |
writeArrayInt(int[] ref,
int offset,
int len)
Method to put a int array in the "array cache". |
void |
writeArrayLong(long[] ref,
int offset,
int len)
Method to put a long array in the "array cache". |
void |
writeArrayShort(short[] ref,
int offset,
int len)
Method to put a short array in the "array cache". |
void |
writeBoolean(boolean value)
Writes a boolean value to the accumulator. |
void |
writeByte(byte value)
Writes a byte value to the accumulator. |
void |
writeByteBuffer(ByteBuffer value)
Writes the contents of the byte buffer (between its current position and its limit). |
void |
writeChar(char value)
Writes a char value to the accumulator. |
void |
writeDouble(double value)
Writes a double value to the accumulator. |
void |
writeFloat(float value)
Writes a float value to the accumulator. |
void |
writeInt(int value)
Writes a int value to the accumulator. |
void |
writeLong(long value)
Writes a long value to the accumulator. |
void |
writeShort(short value)
Writes a short value to the accumulator. |
void |
writeString(String str)
Writes a String to the output. |
void |
writeUTF(String str)
|
Methods inherited from class ibis.io.ByteSerializationOutputStream |
---|
realClose, reInitOnNewConnection, reset, reset, setReplacer, writeArray, writeArray, writeArray, writeArray, writeArray, writeArray, writeArray, writeArray, writeArray, writeArray, writeObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSerializationOutputStream(DataOutputStream out) throws IOException
DataOutputStream
.
out
- the underlying DataOutputStream
IOException
- gets thrown when an IO error occurs.Method Detail |
---|
public String serializationImplName()
SerializationOutput
serializationImplName
in interface SerializationOutput
serializationImplName
in class ByteSerializationOutputStream
public void statistics()
SerializationOutput
statistics
in interface SerializationOutput
statistics
in class ByteSerializationOutputStream
public void writeArrayBoolean(boolean[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayByte(byte[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void internalWriteByteBuffer(ByteBuffer value) throws IOException
IOException
public void writeArrayChar(char[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayShort(short[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayInt(int[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayLong(long[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayFloat(float[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void writeArrayDouble(double[] ref, int offset, int len) throws IOException
ref
- the array to be writtenoffset
- the offset at which to startlen
- number of elements to write
IOException
- on IO error.public void flush() throws IOException
flush
in interface SerializationOutput
flush
in class ByteSerializationOutputStream
IOException
- on an IO error.public void writeBoolean(boolean value) throws IOException
writeBoolean
in interface DataOutput
writeBoolean
in class ByteSerializationOutputStream
value
- The boolean value to write.
IOException
- on IO error.public void writeByte(byte value) throws IOException
writeByte
in interface DataOutput
writeByte
in class ByteSerializationOutputStream
value
- The byte value to write.
IOException
- on IO error.public void writeChar(char value) throws IOException
writeChar
in interface DataOutput
writeChar
in class ByteSerializationOutputStream
value
- The char value to write.
IOException
- on IO error.public void writeShort(short value) throws IOException
writeShort
in interface DataOutput
writeShort
in class ByteSerializationOutputStream
value
- The short value to write.
IOException
- on IO error.public void writeInt(int value) throws IOException
writeInt
in interface DataOutput
writeInt
in class ByteSerializationOutputStream
value
- The int value to write.
IOException
- on IO error.public void writeLong(long value) throws IOException
writeLong
in interface DataOutput
writeLong
in class ByteSerializationOutputStream
value
- The long value to write.
IOException
- on IO error.public void writeFloat(float value) throws IOException
writeFloat
in interface DataOutput
writeFloat
in class ByteSerializationOutputStream
value
- The float value to write.
IOException
- on IO error.public void writeDouble(double value) throws IOException
writeDouble
in interface DataOutput
writeDouble
in class ByteSerializationOutputStream
value
- The double value to write.
IOException
- on IO error.public void writeString(String str) throws IOException
SerializationOutput
String
to the output.
A duplicate check for this String
object
is performed: if the object was already written to this
message, a handle for this object is written instead of
the object itself.
writeString
in interface SerializationOutput
writeString
in class ByteSerializationOutputStream
str
- the string to write.
IOException
- an error occurredpublic void writeUTF(String str) throws IOException
IOException
public void writeArray(boolean[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(byte[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeByteBuffer(ByteBuffer value) throws IOException
DataOutput
writeByteBuffer
in interface DataOutput
writeByteBuffer
in class ByteSerializationOutputStream
value
- the byte buffer from which data is to be written
IOException
- an error occurredpublic void writeArray(short[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(char[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(int[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(long[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(float[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void writeArray(double[] ref, int off, int len) throws IOException
DataOutput
writeArray
in interface DataOutput
writeArray
in class ByteSerializationOutputStream
ref
- the array to writeoff
- the offset at which to startlen
- the number of elements to be copied
IOException
- on an IO errorpublic void close() throws IOException
SerializationOutput
close
in interface SerializationOutput
close
in class ByteSerializationOutputStream
IOException
- an error occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |