code: public static int readLength(InputStream in) throws IOException, EOFException {
          int b0 = in.read();
          if (b0 < 0) {
              throw new EOFException();
          }
          if (b0 <= 0x7f) {
              return b0;
          }
          int b1 = in.read();
          if (b1 < 0) {
              throw new EOFException();
          }
          if (b0 <= 0xbf) {
              return ((b0 & 0x3f) << 8) | b1;
          }
          int b2 = in.read();
          if (b2 < 0) {
              throw new EOFException();
          }
          if (b0 <= 0xdf) {
              return ((b0 & 0x1f) << 16) | (b1 << 8) | b2;
          }
          int b3 = in.read();
          if (b3 < 0) {
              throw new EOFException();
          }
          if (b0 <= 0xef) {
              return ((b0 & 0x0f) << 24) | (b1 << 16) | (b2 << 8) | b3;
          }
          int b4 = in.read();
          if (b4 < 0) {
              throw new EOFException();
          }
          return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
      }
docs: Decodes a length value which was encoded by {@link DataEncoder#writeLength}.
  
  @return length value
  @since 1.2