/** * Encode an object. * @param obj The object. * @throws IOException */ public Object encode(Object val, ClassLoader classloader, IEncodingContext context) { return encodeBytes((byte[])val, classloader); }
/** * Decode an object. * @return The decoded object. * @throws IOException */ public Object decode(Object bytes, ClassLoader classloader, IErrorReporter rep) { return decodeBytes(bytes instanceof byte[] ? new ByteArrayInputStream((byte[])bytes) : (ByteArrayInputStream)bytes, classloader); }
/** * Decode an object. * @return The decoded object. * @throws IOException */ public Object decode(Object bytes, ClassLoader classloader, IErrorReporter rep) { return decodeBytes(bytes instanceof byte[] ? new ByteArrayInputStream((byte[])bytes) : (ByteArrayInputStream)bytes, classloader); }
/** * Decode bytes. * @return The decoded bytes. * @throws IOException */ public static byte[] decodeBytes(byte[] bytes, ClassLoader classloader) { return decodeBytes(new ByteArrayInputStream(bytes), classloader); }
/** * Encode an object. * @param obj The object. * @throws IOException */ public Object encode(Object val, ClassLoader classloader, IEncodingContext context) { return encodeBytes((byte[])val, classloader); }
/** * Decode bytes. * @return The decoded bytes. * @throws IOException */ public static byte[] decodeBytes(byte[] bytes, ClassLoader classloader) { return decodeBytes(new ByteArrayInputStream(bytes), classloader); }