Exception exception = null;
final ByteBuffer data = _data.duplicate();
try
{
ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream(new InputStream()
{
@Override
public int read() throws IOException
{
return data.get();
}
@Override
public int read(byte[] b, int off, int len) throws IOException
{
len = data.remaining() < len ? data.remaining() : len;
data.get(b, off, len);
return len;
}
});
return (Serializable) in.readObject();
}
catch (ClassNotFoundException e)
{
exception = e;
}