Class BlockMarshaller
java.lang.Object
org.jboss.marshalling.serial.BlockMarshaller
- All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, ObjectStreamConstants, AutoCloseable, ByteOutput, Marshaller, ExtendedObjectStreamConstants
public final class BlockMarshaller
extends Object
implements Marshaller, ExtendedObjectStreamConstants
-
Field Summary
FieldsFields inherited from interface ExtendedObjectStreamConstants
TC_CLASSTABLEDESC, TC_OBJECTTABLEFields inherited from interface ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDiscard the class cache.voidDiscard the instance cache.voidclose()private voiddoWriteObject(Object obj, boolean unshared) voidfinish()Finish marshalling to a stream.voidflush()voidstart(ByteOutput newOutput) Begin marshalling to a stream.voidwrite(byte[] b) Write all the bytes from the given array to the stream.voidwrite(byte[] bytes, int off, int len) Write some of the bytes from the given array to the stream.voidwrite(int v) Writes to the output stream the eight low-order bits of the argumentb.voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteObject(Object obj) voidWrite an object to the underlying storage or stream as a new instance.voidwriteShort(int v) void
-
Field Details
-
serialMarshaller
-
buffer
private final byte[] buffer -
position
private int position
-
-
Constructor Details
-
BlockMarshaller
BlockMarshaller(SerialMarshaller marshaller, int bufferSize)
-
-
Method Details
-
start
Description copied from interface:MarshallerBegin marshalling to a stream.- Specified by:
startin interfaceMarshaller- Parameters:
newOutput- the new stream- Throws:
IOException- if an error occurs during setup, such as an error writing the header
-
clearInstanceCache
Description copied from interface:MarshallerDiscard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.- Specified by:
clearInstanceCachein interfaceMarshaller- Throws:
IOException- if an error occurs
-
clearClassCache
Description copied from interface:MarshallerDiscard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCachein interfaceMarshaller- Throws:
IOException- if an error occurs
-
finish
Description copied from interface:MarshallerFinish marshalling to a stream. Any transient class or instance cache is discarded. The stream is released. No further marshalling may be done until theMarshaller.start(ByteOutput)method is again invoked.- Specified by:
finishin interfaceMarshaller- Throws:
IOException- if an error occurs
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
doWriteObject
- Throws:
IOException
-
write
Description copied from interface:ByteOutputWrites to the output stream the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Parameters:
v- the byte to write- Throws:
IOException- if an error occurs
-
write
Description copied from interface:ByteOutputWrite all the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Parameters:
b- the byte array- Throws:
IOException- if an error occurs
-
write
Description copied from interface:ByteOutputWrite some of the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Parameters:
bytes- the byte arrayoff- the index to start writing fromlen- the number of bytes to write- Throws:
IOException- if an error occurs
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Throws:
IOException
-