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 void
clearClassCache()
Discard the class cache.void
clearInstanceCache()
Discard the instance cache.void
close()
void
finish()
Finish marshalling to a stream.void
flush()
void
start(ByteOutput newOutput)
Begin marshalling to a stream.void
write(byte[] b)
Write all the bytes from the given array to the stream.void
write(byte[] bytes, int off, int len)
Write some of the bytes from the given array to the stream.void
write(int v)
Writes to the output stream the eight low-order bits of the argumentb
.void
writeBoolean(boolean v)
void
writeByte(int v)
void
writeBytes(String s)
void
writeChar(int v)
void
writeChars(String s)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object obj)
void
writeObjectUnshared(Object obj)
Write an object to the underlying storage or stream as a new instance.void
writeShort(int v)
void
writeUTF(String s)
-
-
-
Method Detail
-
start
public void start(ByteOutput newOutput) throws IOException
Description copied from interface:Marshaller
Begin marshalling to a stream.- Specified by:
start
in 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 IOException
Description copied from interface:Marshaller
Discard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.- Specified by:
clearInstanceCache
in interfaceMarshaller
- Throws:
IOException
- if an error occurs
-
clearClassCache
public void clearClassCache() throws IOException
Description copied from interface:Marshaller
Discard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCache
in interfaceMarshaller
- Throws:
IOException
- if an error occurs
-
finish
public void finish() throws IOException
Description copied from interface:Marshaller
Finish 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:
finish
in interfaceMarshaller
- Throws:
IOException
- if an error occurs
-
writeObject
public void writeObject(Object obj) throws IOException
- Specified by:
writeObject
in interfaceObjectOutput
- Throws:
IOException
-
writeObjectUnshared
public void writeObjectUnshared(Object obj) throws IOException
Description copied from interface:Marshaller
Write 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:
writeObjectUnshared
in interfaceMarshaller
- Parameters:
obj
- the object to be written- Throws:
IOException
- if an error occurs
-
write
public void write(int v) throws IOException
Description copied from interface:ByteOutput
Writes to the output stream the eight low-order bits of the argumentb
. The 24 high-order bits ofb
are ignored.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Parameters:
v
- the byte to write- Throws:
IOException
- if an error occurs
-
write
public void write(byte[] b) throws IOException
Description copied from interface:ByteOutput
Write all the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Parameters:
b
- the byte array- Throws:
IOException
- if an error occurs
-
write
public void write(byte[] bytes, int off, int len) throws IOException
Description copied from interface:ByteOutput
Write some of the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in 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:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceObjectOutput
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Throws:
IOException
-
-