code: public void readAckFrame() throws IOException {
          byte[] buffer = new byte[6];
          int bytesReceived = 0;
  
          while ((bytesReceived = bytesReceived + in.read(buffer, bytesReceived, buffer.length - bytesReceived)) != -1) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                  Tr.event(tc, "Ack - total bytes received = " + bytesReceived);
  
              if (bytesReceived == 6) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Ack - buffer = ", buffer);
                  }
  
                  String frameType = new String(Arrays.copyOfRange(buffer, 1, 2), UTF_8);
                  if (frameType.equals("A")) {
                      int sequenceNumber = ByteBuffer.wrap(Arrays.copyOfRange(buffer, 2, 6)).getInt();
  
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                          Tr.event(tc, "Ack - received sequence number = " + sequenceNumber + " expecting sequence number = " + (seqNumber - 1));
  
                      if (sequenceNumber >= (seqNumber - 1)) {
                          break;
                      }
                  } else {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                          Tr.event(tc, "Ack - unknown frame type " + frameType);
                      }
                      //Unknown frame type
                  }
                  bytesReceived = 0;
                  buffer = new byte[6];
              }
          }
      }
docs: Reads ack frames in bytes from the wire.
  This method blocks till all the acks are received for
  frames written to the wire.
  
  @throws IOException