BaseSerializingTranscoder Class Reference

Inherits net::spy::SpyObject.

Inherited by SerializingTranscoder, and WhalinTranscoder.

Collaboration diagram for BaseSerializingTranscoder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void setCharset (String to)
void setCompressionThreshold (int to)

Static Public Attributes

static final int DEFAULT_COMPRESSION_THRESHOLD = 16384

Protected Member Functions

byte[] compress (byte[] in)
String decodeString (byte[] data)
byte[] decompress (byte[] in)
Object deserialize (byte[] in)
byte[] encodeString (String in)
byte[] serialize (Object o)

Protected Attributes

String charset = DEFAULT_CHARSET
int compressionThreshold = DEFAULT_COMPRESSION_THRESHOLD

Static Private Attributes

static final String DEFAULT_CHARSET = "UTF-8"


Detailed Description

Base class for any transcoders that may want to work with serialized or compressed data.

Member Function Documentation

byte [] compress ( byte[]  in  )  [protected]

Compress the given array of bytes.

String decodeString ( byte[]  data  )  [protected]

Decode the string with the current character set.

byte [] decompress ( byte[]  in  )  [protected]

Decompress the given array of bytes.

Returns:
null if the bytes cannot be decompressed

Object deserialize ( byte[]  in  )  [protected]

Get the object represented by the given serialized bytes.

byte [] encodeString ( String  in  )  [protected]

Encode a string into the current character set.

byte [] serialize ( Object  o  )  [protected]

Get the bytes representing the given serialized object.

void setCharset ( String  to  ) 

Set the character set for string value transcoding (defaults to UTF-8).

void setCompressionThreshold ( int  to  ) 

Set the compression threshold to the given number of bytes. This transcoder will attempt to compress any data being stored that's larger than this.

Parameters:
to the number of bytes


Member Data Documentation

final String DEFAULT_CHARSET = "UTF-8" [static, private]

final int DEFAULT_COMPRESSION_THRESHOLD = 16384 [static]

Default compression threshold value.


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:38 2012 for Project Wonder by  doxygen 1.5.8