Code example for ObjectOutput

Methods: writeIntwrite

0
   } 
 
   public static class Externalizer extends AbstractExternalizer<ByteArrayKey> { 
      @Override 
      public void writeObject(ObjectOutput output, ByteArrayKey key) throws IOException {
         output.writeInt(key.data.length);
         output.write(key.data);
      } 
 
      @Override 
      public ByteArrayKey readObject(ObjectInput input) throws IOException, ClassNotFoundException {
         byte[] data = new byte[input.readInt()];
         input.readFully(data);
         return new ByteArrayKey(data);
      } 
 
      @Override 
      public Integer getId() {
         return Ids.BYTE_ARRAY_KEY; 
      } 
Contextual code suggestions in your IDE  Get Codota for Java