List of utility methods to do ByteBuffer Set
void | setUniqueness(ByteBuffer bb, long uniqueness) set Uniqueness bb.putLong(uniquenessPos, uniqueness); |
void | setUnsignedInt32(ByteBuffer buffer, int offset, long value) set Unsigned Int if ((value < 0) || (value > 0xffffffffL)) { throw new IllegalArgumentException("uint32 value of out range: " + value); buffer.putInt(offset, (int) value); |
void | setZipEocdCentralDirectoryOffset(ByteBuffer zipEndOfCentralDirectory, long offset) Sets the offset of the start of the ZIP Central Directory in the archive. assertByteOrderLittleEndian(zipEndOfCentralDirectory); setUnsignedInt32(zipEndOfCentralDirectory, zipEndOfCentralDirectory.position() + ZIP_EOCD_CENTRAL_DIR_OFFSET_FIELD_OFFSET, offset); |
ByteBuffer[] | subsequence(ByteBuffer[] bs, int offset, int length) subsequence if ((offset == 0) && (length == bs.length)) return bs; int n = length; ByteBuffer[] bs2 = new ByteBuffer[n]; for (int i = 0; i < n; i++) bs2[i] = bs[offset + i]; return bs2; |
int | substringBetweenLast(final byte[] text, final int offset, final int limit, final byte[] start, final byte[] end, final boolean trim, ByteBuffer bb) substring Between Last int nEnd = lastIndexOf(text, offset, limit, end); int nStart = -1; if (nEnd > start.length) { nStart = lastIndexOf(text, offset, nEnd - 1, start); if (nStart < nEnd && nStart != -1 && nEnd != -1) { nStart += start.length; if (trim) { byte c; ... |
void | updateChecksum(CRC32 checksum, ByteBuffer buffer, int offset, int length) Updates checksum with the provided ByteBuffer at the given offset + length. int position = buffer.position(); int limit = buffer.limit(); buffer.position(offset).limit(offset + length); checksum.update(buffer); buffer.position(position).limit(limit); |
boolean | validBytesUTF8(ByteBuffer buf, int offset, int limit) valid Bytes UTF for (int index = offset; index < limit;) { byte leadingByte = buf.get(index++); if ((leadingByte & 0xc0) == 0x80) { return false; int remaining = remainingBytesUTF8(leadingByte); switch (remaining) { case 0: ... |