@ Override public int toByteArray ( Object o , byte arr [ ] , int startIndex , int availableSize ) { out . resetForReUse ( ) ; writeTarget . setBase ( arr , startIndex , availableSize ) ; try { out . writeObject ( o ) ; } catch ( IOException e ) { FSTUtil . < RuntimeException > rethrow ( e ) ; } int written = out . getWritten ( ) ; return written ; }
throws FSTBufferTooSmallExcpetion in case object does not fit into given range Zero Copy method