James Howe created CODEC-261:
--------------------------------
Summary: Unable to encode read-only ByteBuffer
Key: CODEC-261
URL: https://issues.apache.org/jira/browse/CODEC-261
Project: Commons Codec
Issue Type: Bug
Affects Versions: 1.13
Reporter: James Howe
A read-only array-backed {{ByteBuffer}} fails to encode, because the backing
array is not accessible.
{code:java}
Hex.encodeHex(ByteBuffer.wrap(new byte[]{1}).asReadOnlyBuffer())
{code}
{noformat}
java.nio.ReadOnlyBufferException
at java.nio.ByteBuffer.array(ByteBuffer.java:996)
at org.apache.commons.codec.binary.Hex.encodeHex(Hex.java:213)
at org.apache.commons.codec.binary.Hex.encodeHex(Hex.java:172)
at org.apache.commons.codec.binary.Hex.encodeHex(Hex.java:140)
{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)