public byte [ ] write ( final SpecificRecord message , final long sequence ) { final String classId = getClassId ( message . getClass ( ) ) ; try ( final ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ) { LOG . log ( Level . FINEST , "Serializing message: {0}" , classId ) ; final IMessageSerializer serializer = this . nameToSerializerMap . get ( classId ) ; if ( serializer != null ) { serializer . serialize ( outputStream , message , sequence ) ; } return outputStream . toByteArray ( ) ; } catch ( final IOException e ) { throw new RuntimeException ( "Failure writing message: " + classId , e ) ; } }
Marshall the input message to a byte array .