default ByteBuffer toTemporaryDirectByteBuffer() throws IllegalArgumentException { int len = Maths.toUInt31(readRemaining()); try { ByteBuffer bb = ByteBuffer.allocateDirect(len); copyTo(bb); bb.clear(); return bb; } catch (BufferUnderflowException e) { throw new AssertionError(e); } }