code: private final int deserializeDataSegment (final ByteBuffer pdu, final int offset) throws IOException , InternetSCSIException , DigestException {
  
          final int length = basicHeaderSegment.getDataSegmentLength();
  
          if (dataSegment == null || dataSegment.limit() < length) {
              dataSegment = ByteBuffer.allocate(AbstractDataSegment.getTotalLength(length));
          }
          dataSegment.put(pdu);
  
          dataSegment.flip();
  
          // read data segment digest and validate
          if (basicHeaderSegment.getParser().canHaveDigests()) {
              deserializeDigest(pdu, offset, length, dataDigest);
          }
  
          if (dataSegment == null) {
              return 0;
          } else {
              return dataSegment.limit();
          }
      }
docs: Deserializes a array (starting from the given offset) and store the informations to the Data Segment.
  
  @param pdu The array to read from.
  @param offset The offset to start from.
  @return The length of the written bytes.
  @throws IOException if an I/O error occurs.
  @throws InternetSCSIException If any violation of the iSCSI-Standard emerge.
  @throws DigestException There is a mismatch of the digest.