Package org.jboss.marshalling.river
Class BlockMarshaller
- java.lang.Object
-
- org.jboss.marshalling.river.BlockMarshaller
-
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,ObjectOutput,AutoCloseable,ByteOutput,Marshaller
public final class BlockMarshaller extends Object implements Marshaller
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearClassCache()Discard the class cache.voidclearInstanceCache()Discard the instance cache.voidclose()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)voidwriteObjectUnshared(Object obj)Write an object to the underlying storage or stream as a new instance.voidwriteShort(int v)voidwriteUTF(String s)
-
-
-
Method Detail
-
start
public void start(ByteOutput newOutput) throws IOException
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
public void clearInstanceCache() throws IOExceptionDescription 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
public void clearClassCache() throws IOExceptionDescription copied from interface:MarshallerDiscard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCachein interfaceMarshaller- Throws:
IOException- if an error occurs
-
finish
public void finish() throws IOExceptionDescription 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
public void writeObject(Object obj) throws IOException
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
writeObjectUnshared
public void writeObjectUnshared(Object obj) throws IOException
Description copied from interface:MarshallerWrite an object to the underlying storage or stream as a new instance. The class that implements this interface defines how the object is written.- Specified by:
writeObjectUnsharedin interfaceMarshaller- Parameters:
obj- the object to be written- Throws:
IOException- if an error occurs
-
write
public void write(int v) throws IOExceptionDescription 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
public void write(byte[] b) throws IOExceptionDescription 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
public void write(byte[] bytes, int off, int len) throws IOExceptionDescription 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
public void writeBoolean(boolean v) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Throws:
IOException
-
-