private int parseEncryptedKeyBlobList()

in src/main/java/com/amazonaws/encryptionsdk/model/CiphertextHeaders.java [352:375]


  private int parseEncryptedKeyBlobList(final byte[] b, final int off)
      throws PartialParseException {
    int parsedBytes = 0;
    try {
      if (cipherKeyCount_ > 0) {
        while (currKeyBlobIndex_ < cipherKeyCount_) {
          if (cipherKeyBlobs_.get(currKeyBlobIndex_) == null) {
            cipherKeyBlobs_.set(currKeyBlobIndex_, new KeyBlob());
          }
          if (cipherKeyBlobs_.get(currKeyBlobIndex_).isComplete() == false) {
            parsedBytes += parseEncryptedKeyBlob(b, off + parsedBytes);
            // check if we had enough bytes to parse the key blob
            if (cipherKeyBlobs_.get(currKeyBlobIndex_).isComplete() == false) {
              throw new ParseException("Not enough bytes to parse key blob");
            }
          }
          currKeyBlobIndex_++;
        }
      }
    } catch (final ParseException ex) {
      throw new PartialParseException(ex, parsedBytes);
    }
    return parsedBytes;
  }