@@ -503,20 +503,37 @@ private int parseComplete(final byte[] b, final int off) throws ParseException {
503
503
return 0 ;
504
504
}
505
505
506
+
506
507
/**
507
508
* Deserialize the provided bytes starting at the specified offset to construct an instance of
508
- * this class.
509
+ * this class. Uses the default value for maxEncryptedDataKeys, which results in no limit.
509
510
*
510
- * <p>This method parses the provided bytes for the individual fields in this class. This methods
511
+ * <p>This method parses the provided bytes for the individual fields in this class. This method
511
512
* also supports partial parsing where not all the bytes required for parsing the fields
512
513
* successfully are available.
513
514
*
514
515
* @param b the byte array to deserialize.
515
516
* @param off the offset in the byte array to use for deserialization.
516
- * @param maxEncryptedDataKeys the maximum number of EDKs to deserialize; zero indicates no
517
- * maximum
518
517
* @return the number of bytes consumed in deserialization.
519
518
*/
519
+ public int deserialize (final byte [] b , final int off ) throws ParseException {
520
+ return deserialize (b , off , NO_MAX_ENCRYPTED_DATA_KEYS );
521
+ }
522
+
523
+ /**
524
+ * Deserialize the provided bytes starting at the specified offset to construct an instance of
525
+ * this class.
526
+ *
527
+ * <p>This method parses the provided bytes for the individual fields in this class. This method
528
+ * also supports partial parsing where not all the bytes required for parsing the fields
529
+ * successfully are available.
530
+ *
531
+ * @param b the byte array to deserialize.
532
+ * @param off the offset in the byte array to use for deserialization.
533
+ * @param maxEncryptedDataKeys the maximum number of EDKs to deserialize; zero indicates no
534
+ * maximum
535
+ * @return the number of bytes consumed in deserialization.
536
+ */
520
537
public int deserialize (final byte [] b , final int off , int maxEncryptedDataKeys )
521
538
throws ParseException {
522
539
if (b == null ) {
@@ -835,6 +852,16 @@ public void setSuiteData(byte[] suiteData) {
835
852
suiteData_ = suiteData .clone ();
836
853
}
837
854
855
+ /**
856
+ * Return max encrypted data keys
857
+ * Package scope for unit testing.
858
+ *
859
+ * @return int
860
+ */
861
+ int getMaxEncryptedDataKeys () {
862
+ return maxEncryptedDataKeys_ ;
863
+ }
864
+
838
865
private static class PartialParseException extends Exception {
839
866
private static final long serialVersionUID = 1L ;
840
867
final int bytesParsed_ ;
0 commit comments