Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Interface ByteSequence

All Known Subinterfaces:
ReadBuffer
All Known Implementing Classes:
AbstractByteArrayReadBuffer, AbstractByteSequence, AbstractByteSequence.AggregateByteSequence, AbstractByteSequence.PartialByteSequence, AbstractReadBuffer, Binary, ByteArrayReadBuffer, ByteBufferReadBuffer, MultiBufferReadBuffer

public interface ByteSequence

Represents a sequence of bytes.

Since:
Coherence 3.7
Author:
cp 2010-06-06

Method Summary
 byte byteAt(int of)
          Determine the n-th byte of the byte sequence.
 int length()
          Determine the number of bytes of data represented by this ByteSequence.
 ByteSequence subSequence(int ofStart, int ofEnd)
          Returns a new ByteSequence that is a subsequence of this sequence.
 Binary toBinary()
          Returns a Binary object that holds the contents of this ByteSequence.

 

Method Detail

length

int length()
Determine the number of bytes of data represented by this ByteSequence.
Returns:
the number of bytes represented by this Node

byteAt

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 < length())
Returns:
the byte at the specified offset
Throws:
java.lang.IndexOutOfBoundsException - if (of < 0 || of >= ())

subSequence

ByteSequence subSequence(int ofStart,
                         int ofEnd)
Returns a new ByteSequence that is a subsequence of this sequence. The subsequence starts with the byte value at the specified index and ends with the byte value at index ofEnd - 1. The length (in bytes) of the returned sequence is ofEnd - ofStart, so if ofStart == ofEnd then an empty sequence is returned.
Parameters:
ofStart - the start index, inclusive
ofEnd - the end index, exclusive
Returns:
the specified subsequence
Throws:
java.lang.IndexOutOfBoundsException - if ofStart or ofEnd are negative, if ofEnd is greater than length(), or if ofStart is greater than ofEnd

toBinary

Binary toBinary()
Returns a Binary object that holds the contents of this ByteSequence.
Returns:
the contents of this ByteSequence as a Binary object

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.