public void writeBytes(byte[] bytes, int code) throws IOException {
    out.write(code);
    out.writeInt(bytes.length);
    out.write(bytes);
  }
Writes a bytes array as a typed bytes sequence, using a given typecode.

@param bytes
         the bytes array to be written
@param code
         the typecode to use
@throws IOException
contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/TypedBytesOutput.java