Code example for DataInput

Methods: readFullyreadInt

0
   } 
 
   @Override 
   public void readFields(DataInput in) throws IOException {
      try { 
         int length = in.readInt();
         byte b[] = new byte[length];
         in.readFully(b);
         reader.setBuffer(b);
      } catch (EOFException ex) {
         throw new IOException(ex);
      } 
   } 
 
   @Override 
   public void write(DataOutput out) throws IOException {
      byte b[] = writer.getAsByteBlock();
      out.write(b);
   } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE