|
||||||||||
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 PositionableModel>
The ObjectSerializer
class TODO add class documentation here.
Constructor Summary | |
---|---|
ObjectSerializer()
|
Method Summary | |
---|---|
ByteBuffer |
allocateByteBuffer(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(String uuid)
|
abstract T |
read(ByteBuffer buffer)
Create a PositionableModel by reading it from the buffer. |
String |
readID(ByteBuffer buffer)
Read the id of this object and reset the position to it's start position. |
int |
readObjectSize(ByteBuffer buffer)
Read the size of the serialized object and reset the position to it's start position. |
static String |
readString(ByteBuffer buffer)
Reads a string from the buffer, using UTF-8. |
long |
readTime(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(String string)
Return the size of the given string in UTF-8 plus the length index |
void |
skipHeader(ByteBuffer buffer)
Skips the header. |
abstract void |
write(ByteBuffer buffer,
DataObjectInfo<T> object)
Write the given PositionableModel to the buffer. |
void |
writeHeader(ByteBuffer buffer,
DataObjectInfo<T> object)
Writes the default header, consisting of the totalSize, id and the currentTimeMillis(). |
static void |
writeString(ByteBuffer buffer,
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(ByteBuffer buffer, DataObjectInfo<T> object)
PositionableModel
to the buffer.
buffer
- object
- public abstract T read(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(ByteBuffer buffer, DataObjectInfo<T> object)
buffer
- object
- to write the header from.public void skipHeader(ByteBuffer buffer)
buffer
- public ByteBuffer allocateByteBuffer(FileChannel channel) throws IOException
channel
-
IOException
public int sizeOfSerializedObject(DataObjectInfo<T> object)
object
- to get the size from
public String readID(ByteBuffer buffer)
buffer
- to read from
public long readTime(ByteBuffer buffer)
buffer
- to read from
public int getHeaderSize(String uuid)
uuid
-
public static void writeString(ByteBuffer buffer, String string)
buffer
- string
- public static String readString(ByteBuffer buffer)
buffer
-
public static int sizeOfString(String string)
string
-
public int readObjectSize(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 |