src/main/java/org/nustaq/serialization/FSTConfiguration.java
public byte[] asByteArray( Object object ) {
        FSTObjectOutput objectOutput = getObjectOutput();
        try {
            objectOutput.writeObject(object);
            return objectOutput.getCopyOfWrittenBuffer();
        } catch (IOException e) {
            try {
//                FSTConfiguration.prettyPrintJson(object); endless cycle !
            } catch (Exception ee) {
                //
            }
            FSTUtil.<RuntimeException>rethrow(e);
        }
        return null;
    }
public byte[] asByteArray( Object object ) {
        FSTObjectOutput objectOutput = getObjectOutput();
        try {
            objectOutput.writeObject(object);
            return objectOutput.getCopyOfWrittenBuffer();
        } catch (IOException e) {
            try {
//                FSTConfiguration.prettyPrintJson(object); endless cycle !
            } catch (Exception ee) {
                //
            }
            FSTUtil.<RuntimeException>rethrow(e);
        }
        return null;
    }
convenience. (object must be serializable)