code: public void read(byte[] holder) throws ProtocolException {
          int readTotal = 0;
          try {
              while (readTotal < holder.length) {
                  int count = input.read(holder, readTotal, holder.length - readTotal);
                  if (count == -1) {
                      throw new ProtocolException("Unexpected end of stream.");
                  }
                  readTotal += count;
              }
              // Unset the next char.
              nextSeen = false;
              nextChar = 0;
          } catch (IOException e) {
              throw new ProtocolException("Error reading from stream.", e);
          }
      }
docs: Reads and consumes a number of characters from the underlying reader,
  filling the byte array provided.
  
  @param holder A byte array which will be filled with bytes read from the underlying reader.
  @throws ProtocolException If a char can't be read into each array element.