public int writeSchemaId ( OutputStream os , int schemaId ) throws IOException { if ( schemaId > 0 ) { os . write ( MAGIC_BYTE ) ; os . write ( ByteBuffer . allocate ( ID_SIZE ) . putInt ( schemaId ) . array ( ) ) ; } return schemaId ; }
Writes the magic byte and schema ID to an output stream replicating the functionality of the Confluent Kafka Avro Serializer