java.lang.Object |
↳ |
com.pnfsoftware.jeb.util.serialization.Serializer |
Class Overview
This class allows the serialization of object(s) to a stream of bytes.
The serialize(Object)
method is interruptible.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.pnfsoftware.jeb.util.serialization.IInternalSerializer
|
Fields
public
Map<String, List<Object>>
dbgObjectStores
public
Set<Integer>
dbgTypeIds
public
long
writtenStringBytesCount
public
int
writtenStringCount
public
Set<String>
writtenStringPool
Public Constructors
public
Serializer
(ITypeIdProvider customTypeIdProvider, OutputStream stream, boolean generateStringPool)
Public Methods
public
void
debugEnable
(boolean enableObjectCounting, boolean enableObjectStoring, boolean enableTypeIdStoring)
public
void
debugEnableWrittenStringPool
(boolean enable)
public
Map<String, List<Object>>
debugGetObjectStores
()
public
List<C>
debugGetObjectStores
(Class<C> clazz)
public
Set<Integer>
debugGetTypeIds
()
public
long
getLastWrittenSize
()
Retrieve the number of bytes (may be approximate) generated by the last call made to
serialize(Object)
.
Returns
- a number of bytes, possibly an approximation if the last call to
serialize(Object)
was made in simulation
mode
public
int
getObjectCount
()
Retrieve the number of serialized or partially serialized objects.
CAREFUL! the number of objects fully serialized (entirely written to the stream) is less
than or equal to that number. Use getWrittenObjectCount()
to get it.
public
int
getRootCount
()
public
OutputStream
getStream
()
public
List<String>
getStringPool
()
public
int
getWrittenObjectCount
()
public
long
getWrittenStringBytesCount
()
public
int
getWrittenStringCount
()
public
Set<String>
getWrittenStringPool
()
public
void
serialize
(Object root)
public
void
setCustomSerializationClassFlags
(Class<?> c, int flags)
public
void
setExpectedObjectCount
(int count)
public
void
setup
(boolean simulation)
public
void
write
(Object o)
public
void
writeFields
(Object o, Class<?> targetClass)