code: private byte[] readBytes(final int numBytes, String messageType) throws IOException {
      final String errMsg = isNullOrEmpty(messageType)
                            ? "Error reading from ssh-agent."
                            : "Error reading " + messageType + " from ssh-agent.";
  
      final byte[] result = new byte[numBytes];
  
      final int bytesRead;
      try {
        bytesRead = in.read(result, 0, numBytes);
      } catch (IOException e) {
        log.error(errMsg);
        throw Throwables.propagate(e);
      }
  
      if (bytesRead == -1) {
        log.error(errMsg);
        throw new IOException(errMsg);
      }
  
      return result;
    }
docs: Read n bytes from the {@link InputStream}.
  @param numBytes bytes to read
  @param messageType An optional String indicating the expected SSH2 agent's message type.
  @return byte[]