code: public byte[] readByteArray(int length) throws IOException {
          byte buf[] = new byte[length];
          for (int i = 0; i < length; i++) {
              buf[i] = (byte) read();
          }
          return buf;
      }
docs: Read an array of bytes.
  
  @param length
  size of the array (in bytes)
  @return the array of bytes
  @throws IOException