|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.services.wpvs.io.serializer.ObjectSerializer<T>
T
- public abstract class ObjectSerializer<T extends org.deegree.commons.index.PositionableModel>
The ObjectSerializer
class TODO add class documentation here.
Constructor Summary | |
---|---|
ObjectSerializer()
|
Method Summary | |
---|---|
java.nio.ByteBuffer |
allocateByteBuffer(java.nio.channels.FileChannel channel)
Allocates a byte buffer to hold the total object. |
T |
deserializeDataObject(byte[] buffer)
Deserialize an object from the given byte array. |
int |
getHeaderSize(java.lang.String uuid)
|
abstract T |
read(java.nio.ByteBuffer buffer)
Create a PositionableModel by reading it from the buffer. |
java.lang.String |
readID(java.nio.ByteBuffer buffer)
Read the id of this object and reset the position to it's start position. |
int |
readObjectSize(java.nio.ByteBuffer buffer)
Read the size of the serialized object and reset the position to it's start position. |
static java.lang.String |
readString(java.nio.ByteBuffer buffer)
Reads a string from the buffer, using UTF-8. |
long |
readTime(java.nio.ByteBuffer buffer)
Read the creation time of this object and reset the position to it's start position. |
abstract int |
serializedObjectSize(DataObjectInfo<T> object)
Returns the size of the object after serialization, without the header information, just the fields. |
byte[] |
serializeObject(DataObjectInfo<T> doi)
Serializes an object using the standard serialization mechanism, ObjectOutputStream |
int |
sizeOfSerializedObject(DataObjectInfo<T> object)
Returns the size of the object after serialization, with the header information and the fields. |
static int |
sizeOfString(java.lang.String string)
Return the size of the given string in UTF-8 plus the length index |
void |
skipHeader(java.nio.ByteBuffer buffer)
Skips the header. |
abstract void |
write(java.nio.ByteBuffer buffer,
DataObjectInfo<T> object)
Write the given PositionableModel to the buffer. |
void |
writeHeader(java.nio.ByteBuffer buffer,
DataObjectInfo<T> object)
Writes the default header, consisting of the totalSize, id and the currentTimeMillis(). |
static void |
writeString(java.nio.ByteBuffer buffer,
java.lang.String string)
Writes a string to the buffer, by using UTF-8. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectSerializer()
Method Detail |
---|
public abstract void write(java.nio.ByteBuffer buffer, DataObjectInfo<T> object)
PositionableModel
to the buffer.
buffer
- object
- public abstract T read(java.nio.ByteBuffer buffer)
PositionableModel
by reading it from the buffer.
buffer
-
PositionableModel
public abstract int serializedObjectSize(DataObjectInfo<T> object)
object
- to get the size from
public void writeHeader(java.nio.ByteBuffer buffer, DataObjectInfo<T> object)
buffer
- object
- to write the header from.public void skipHeader(java.nio.ByteBuffer buffer)
buffer
- public java.nio.ByteBuffer allocateByteBuffer(java.nio.channels.FileChannel channel) throws java.io.IOException
channel
-
java.io.IOException
public int sizeOfSerializedObject(DataObjectInfo<T> object)
object
- to get the size from
public java.lang.String readID(java.nio.ByteBuffer buffer)
buffer
- to read from
public long readTime(java.nio.ByteBuffer buffer)
buffer
- to read from
public int getHeaderSize(java.lang.String uuid)
uuid
-
public static void writeString(java.nio.ByteBuffer buffer, java.lang.String string)
buffer
- string
- public static java.lang.String readString(java.nio.ByteBuffer buffer)
buffer
-
public static int sizeOfString(java.lang.String string)
string
-
public int readObjectSize(java.nio.ByteBuffer buffer)
buffer
- to read from
public byte[] serializeObject(DataObjectInfo<T> doi)
ObjectOutputStream
doi
- to be serialized with the ObjectOutputStream
public T deserializeDataObject(byte[] buffer)
buffer
- containing bytes to deserialize.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |