This method is often used in conjunction with the {@link java.nio.ByteBuffer#compact compact} method when transferring data fromone place to another.
311312313314315316317318319320321
PointerBuffer buffer = getLengths(strings.length); for ( CharSequence string : strings ) buffer.put(string.length()); buffer.flip(); return buffer; } /** * Returns a buffer containing the lengths of the specified buffers.
328329330331332333334335336337338
PointerBuffer lengths = getLengths(buffers.length); for ( ByteBuffer buffer : buffers ) lengths.put(buffer.remaining()); lengths.flip(); return lengths; } static int getSize(final PointerBuffer lengths) { long size = 0;