public byte[] getBytes(final byte[] oldBuffer, final int offset, final int length) { final byte[] resultBuffer = oldBuffer.length < length ? new byte[length] : oldBuffer; getBytes(offset, resultBuffer, 0, length); return resultBuffer; }
/** * Not at all a performant conversion: don't use this on a critical application path. * * @param offset The offset within the buffer to start at. * @param length the length in bytes to convert to a String * @return a String */ public String getAscii(final int offset, final int length) { final byte[] buff = new byte[length]; getBytes(offset, buff); return new String(buff, 0, length, US_ASCII); }