public void putLength(int len) throws IOException {
  if (len < 128) {
    write((byte)len);
  }
 else   if (len < (1 << 8)) {
    write((byte)0x081);
    write((byte)len);
  }
 else   if (len < (1 << 16)) {
    write((byte)0x082);
    write((byte)(len >> 8));
    write((byte)len);
  }
 else   if (len < (1 << 24)) {
    write((byte)0x083);
    write((byte)(len >> 16));
    write((byte)(len >> 8));
    write((byte)len);
  }
 else {
    write((byte)0x084);
    write((byte)(len >> 24));
    write((byte)(len >> 16));
    write((byte)(len >> 8));
    write((byte)len);
  }
}

public void putLength ( int len ) throws IOException { if ( len < 128 ) { write ( ( byte ) len ) ; } else if ( len < ( 1 << 8 ) ) { write ( ( byte ) 0x081 ) ; write ( ( byte ) len ) ; } else if ( len < ( 1 << 16 ) ) { write ( ( byte ) 0x082 ) ; write ( ( byte ) ( len > > 8 ) ) ; write ( ( byte ) len ) ; } else if ( len < ( 1 << 24 ) ) { write ( ( byte ) 0x083 ) ; write ( ( byte ) ( len > > 16 ) ) ; write ( ( byte ) ( len > > 8 ) ) ; write ( ( byte ) len ) ; } else { write ( ( byte ) 0x084 ) ; write ( ( byte ) ( len > > 24 ) ) ; write ( ( byte ) ( len > > 16 ) ) ; write ( ( byte ) ( len > > 8 ) ) ; write ( ( byte ) len ) ; } }
put the encoding of the length in the stream .
