Package com.tangosol.util
Class AbstractByteSequence.AggregateByteSequence
java.lang.Object
com.tangosol.util.AbstractByteSequence
com.tangosol.util.AbstractByteSequence.AggregateByteSequence
- All Implemented Interfaces:
ByteSequence
- Enclosing class:
AbstractByteSequence
A naive ByteSequence that glues two ByteSequence instances together.
- Since:
- Coherence 3.7
- Author:
- cp 2010-06-29
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.AbstractByteSequence
AbstractByteSequence.AggregateByteSequence, AbstractByteSequence.PartialByteSequence -
Constructor Summary
ConstructorsConstructorDescriptionAggregateByteSequence(ByteSequence seqFirst, ByteSequence seqSecond) Construct an AggregateByteSequence from two ByteSequence objects. -
Method Summary
Modifier and TypeMethodDescriptionbytebyteAt(int of) Determine the n-th byte of the byte sequence.intlength()Determine the number of bytes of data represented by this ByteSequence.subSequence(int ofStart, int ofEnd) Returns a newByteSequencethat is a subsequence of this sequence.Methods inherited from class com.tangosol.util.AbstractByteSequence
equals, hashCode, toBinary, toString
-
Constructor Details
-
AggregateByteSequence
Construct an AggregateByteSequence from two ByteSequence objects.- Parameters:
seqFirst- the first ByteSequenceseqSecond- the second ByteSequence
-
-
Method Details
-
length
public int length()Determine the number of bytes of data represented by this ByteSequence.- Returns:
- the number of bytes represented by this Node
-
byteAt
public byte byteAt(int of) Determine the n-th byte of the byte sequence.- Parameters:
of- the zero-based byte offset within the sequence of bytes (0 <= of <ByteSequence.length())- Returns:
- the byte at the specified offset
-
subSequence
Returns a newByteSequencethat is a subsequence of this sequence. The subsequence starts with thebytevalue at the specified index and ends with thebytevalue at index ofEnd - 1. The length (inbytes) of the returned sequence is ofEnd - ofStart, so if ofStart == ofEnd then an empty sequence is returned.- Specified by:
subSequencein interfaceByteSequence- Overrides:
subSequencein classAbstractByteSequence- Parameters:
ofStart- the start index, inclusiveofEnd- the end index, exclusive- Returns:
- the specified subsequence
-