Skip to content

Commit

Permalink
add API in avroCompatibilityHelper (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
guawang authored Mar 4, 2021
1 parent 5ea12f7 commit e0e3a01
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ public static Decoder newBoundedMemoryDecoder(InputStream in) throws IOException
return ADAPTER.newBoundedMemoryDecoder(in);
}

/**
* {@link Decoder} that fixes a bug in the BinaryDecoder that can cause OutOfMemoryError
* when deserializing corrupt data or deserializing with the incorrect schema.
* @param data byteArray
* @return a decoder
* @throws IOException on io errors
*/
public static Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
assertAvroAvailable();
return ADAPTER.newBoundedMemoryDecoder(data);
}

// schema parsing, and other Schema-related operations

/**
Expand Down

0 comments on commit e0e3a01

Please sign in to comment.