public class ByteArrayReadBuffer extends AbstractByteArrayReadBuffer
AbstractByteArrayReadBuffer.ByteArrayBufferInput
AbstractReadBuffer.AbstractBufferInput
Base.LoggingWriter, Base.StackFrame
ReadBuffer.BufferInput
m_ab, m_cb, m_of
NO_BINARY, NO_BYTES
LOG_ALWAYS, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_US
UNENCODED
Modifier | Constructor and Description |
---|---|
protected |
ByteArrayReadBuffer()
Default constructor provided for subclasses.
|
|
ByteArrayReadBuffer(byte[] ab)
Construct a ByteArrayReadBuffer object from a byte array.
|
|
ByteArrayReadBuffer(byte[] ab,
int of,
int cb)
Construct a ByteArrayReadBuffer object from a portion of a byte array.
|
|
ByteArrayReadBuffer(byte[] ab,
int of,
int cb,
boolean fCopy,
boolean fPrivate,
boolean fShallowClone)
Construct a ByteArrayReadBuffer object from a portion of a byte array.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Create a clone of this ReadBuffer object.
|
byte[] |
getRawByteArray()
Obtain the byte array that this ReadBuffer uses.
|
int |
getRawOffset()
Determine the offset into the byte array returned from
getRawByteArray() that this ReadBuffer uses. |
protected ReadBuffer |
instantiateReadBuffer(int of,
int cb)
Factory method: Instantiate a ReadBuffer for a portion of this
ReadBuffer.
|
protected boolean |
isByteArrayPrivate()
Determine if the underlying byte[] should be treated as private data.
|
protected boolean |
isShallowCloneable()
Determine whether a clone can be made without cloning the byte array.
|
void |
resetRange(int of,
int cb)
Reset the portion of the byte array the ReadBuffer operates upon.
|
String |
toString()
Provide a human-readable representation of the Binary object.
|
byteAt, copyBytes, equals, instantiateBufferInput, length, toBinary, toBinary, toByteArray, toByteBuffer, toByteBuffer, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
checkBounds, getBufferInput, getEncodedHash, getReadBuffer, readPackedInt, readUnsignedByte, sizeofPackedInt, subSequence, toByteArray
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
protected ByteArrayReadBuffer()
public ByteArrayReadBuffer(byte[] ab)
ab
- an array of bytespublic ByteArrayReadBuffer(byte[] ab, int of, int cb)
ab
- an array of bytesof
- the offset into the byte arraycb
- the number of bytes to extractpublic ByteArrayReadBuffer(byte[] ab, int of, int cb, boolean fCopy, boolean fPrivate, boolean fShallowClone)
ab
- an array of bytesof
- the offset into the byte arraycb
- the number of bytes to extractfCopy
- true to make a copy of the passed arrayfPrivate
- true to treat the passed array as private datafShallowClone
- true to allow cloning without copying the
underlying byte[]public final void resetRange(int of, int cb)
resetRange
in class AbstractByteArrayReadBuffer
of
- an offset into the byte arraycb
- the number of bytes to utilizepublic final byte[] getRawByteArray()
AbstractReadBuffer.toByteArray()
.public final int getRawOffset()
getRawByteArray()
that this ReadBuffer uses. If the
underlying byte array is private, then this method will always
return zero because getRawByteArray()
will always return
a copy of the portion of the byte array that this ReadBuffer
represents.protected final ReadBuffer instantiateReadBuffer(int of, int cb)
instantiateReadBuffer
in class AbstractReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting ReadBufferpublic Object clone()
clone
in interface ReadBuffer
clone
in class AbstractReadBuffer
public String toString()
protected final boolean isByteArrayPrivate()
isByteArrayPrivate
in class AbstractByteArrayReadBuffer
protected final boolean isShallowCloneable()