|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.util.primitives.BytesArray
public class BytesArray
Field Summary | |
---|---|
byte[] |
a
|
static java.nio.charset.CharsetEncoder |
encoder
|
int |
n
|
Fields inherited from interface com.metsci.glimpse.util.primitives.Bytes |
---|
utf8 |
Constructor Summary | |
---|---|
BytesArray()
|
|
BytesArray(byte[] a)
For efficiency, does not clone the array arg. |
|
BytesArray(byte[] a,
int n)
For efficiency, does not clone the array arg. |
|
BytesArray(Bytes xs)
Clones the sequence arg. |
|
BytesArray(int n)
|
|
BytesArray(java.lang.String s)
|
Method Summary | |
---|---|
void |
append(byte v)
|
void |
append(byte[] vs)
|
void |
append(byte[] vs,
int from,
int to)
|
void |
append(java.nio.ByteBuffer vs)
|
void |
append(java.nio.ByteBuffer vs,
int c)
|
void |
append(Bytes vs)
|
void |
append(Bytes vs,
int from,
int to)
|
void |
append(java.lang.String s)
|
void |
append(java.lang.String s,
int from,
int to)
|
void |
compact()
|
byte[] |
copyOf()
|
byte[] |
copyOf(int i,
int c)
|
void |
copyTo(int i,
byte[] dest,
int iDest,
int c)
|
void |
ensureCapacity(int minCapacity)
|
byte |
first()
|
void |
insert(int i,
byte v)
|
void |
insert(int i,
byte[] vs)
|
void |
insert(int i,
byte[] vs,
int from,
int to)
|
void |
insert(int i,
java.nio.ByteBuffer vs)
|
void |
insert(int i,
java.nio.ByteBuffer vs,
int c)
|
void |
insert(int i,
Bytes vs)
|
void |
insert(int i,
Bytes vs,
int from,
int to)
|
void |
insert(int i,
java.lang.String s)
|
void |
insert(int i,
java.lang.String s,
int from,
int to)
|
boolean |
isEmpty()
|
byte |
last()
|
int |
n()
Length of the sequence |
static byte[] |
newArray(int oldCapacity,
int minNewCapacity)
Creates a new array whose capacity is at least minNewCapacity, and at least 1.618 * oldCapacity, up to Integer.MAX_VALUE. |
void |
prepend(byte v)
|
void |
prepend(byte[] vs)
|
void |
prepend(byte[] vs,
int from,
int to)
|
void |
prepend(java.nio.ByteBuffer vs)
|
void |
prepend(java.nio.ByteBuffer vs,
int c)
|
void |
prepend(Bytes vs)
|
void |
prepend(Bytes vs,
int from,
int to)
|
void |
prepend(java.lang.String s)
|
void |
prepend(java.lang.String s,
int from,
int to)
|
void |
prepForAppend(int c)
Makes room in this array for new values to be appended. |
void |
prepForInsert(int i,
int c)
Makes room in this array for new values to be inserted. |
void |
prepForPrepend(int c)
Makes room in this array for new values to be prepended. |
void |
remove(byte v)
Removes a single copy of the specified value. |
void |
set(int i,
byte v)
|
java.lang.String |
string()
|
java.lang.String |
string(int i,
int c)
Strings are encoded and decoded using the UTF-8 charset (multi-byte charsets just aren't worth the increased complication in indexing). |
byte |
v(int i)
Value at index i |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.nio.charset.CharsetEncoder encoder
public byte[] a
public int n
Constructor Detail |
---|
public BytesArray(byte[] a)
public BytesArray(int n)
public BytesArray()
public BytesArray(byte[] a, int n)
public BytesArray(Bytes xs)
public BytesArray(java.lang.String s)
Method Detail |
---|
public byte v(int i)
Bytes
v
in interface Bytes
public int n()
Bytes
n
in interface Bytes
public void copyTo(int i, byte[] dest, int iDest, int c)
copyTo
in interface Bytes
public byte[] copyOf(int i, int c)
copyOf
in interface Bytes
public byte[] copyOf()
copyOf
in interface Bytes
public java.lang.String string()
string
in interface Bytes
public java.lang.String string(int i, int c)
Bytes
string
in interface Bytes
public boolean isEmpty()
isEmpty
in interface Bytes
public byte first()
first
in interface Bytes
public byte last()
last
in interface Bytes
public void set(int i, byte v)
set
in interface BytesModifiable
public void insert(int i, byte v)
insert
in interface BytesModifiable
public void insert(int i, Bytes vs)
insert
in interface BytesModifiable
public void insert(int i, Bytes vs, int from, int to)
insert
in interface BytesModifiable
public void insert(int i, java.lang.String s)
insert
in interface BytesModifiable
public void insert(int i, java.lang.String s, int from, int to)
insert
in interface BytesModifiable
public void insert(int i, byte[] vs)
insert
in interface BytesModifiable
public void insert(int i, byte[] vs, int from, int to)
insert
in interface BytesModifiable
public void insert(int i, java.nio.ByteBuffer vs)
insert
in interface BytesModifiable
public void insert(int i, java.nio.ByteBuffer vs, int c)
insert
in interface BytesModifiable
public void prepForInsert(int i, int c)
this.a
on [i,i+c)
are undefined. Writing meaningful values to these indices is up to the
caller.
i
- The index at which new values will be insertedc
- The count of new values that will be insertedpublic void prepend(byte v)
prepend
in interface BytesModifiable
public void prepend(Bytes vs)
prepend
in interface BytesModifiable
public void prepend(Bytes vs, int from, int to)
prepend
in interface BytesModifiable
public void prepend(java.lang.String s)
prepend
in interface BytesModifiable
public void prepend(java.lang.String s, int from, int to)
prepend
in interface BytesModifiable
public void prepend(byte[] vs)
prepend
in interface BytesModifiable
public void prepend(byte[] vs, int from, int to)
prepend
in interface BytesModifiable
public void prepend(java.nio.ByteBuffer vs)
prepend
in interface BytesModifiable
public void prepend(java.nio.ByteBuffer vs, int c)
prepend
in interface BytesModifiable
public void prepForPrepend(int c)
this.a
on [0,c)
are undefined. Writing meaningful values to these indices is up to the
caller.
c
- The count of new values that will be insertedpublic void append(byte v)
append
in interface BytesModifiable
public void append(Bytes vs)
append
in interface BytesModifiable
public void append(Bytes vs, int from, int to)
append
in interface BytesModifiable
public void append(java.lang.String s)
append
in interface BytesModifiable
public void append(java.lang.String s, int from, int to)
append
in interface BytesModifiable
public void append(byte[] vs)
append
in interface BytesModifiable
public void append(byte[] vs, int from, int to)
append
in interface BytesModifiable
public void append(java.nio.ByteBuffer vs)
append
in interface BytesModifiable
public void append(java.nio.ByteBuffer vs, int c)
append
in interface BytesModifiable
public void prepForAppend(int c)
this.a
on [this.n-c,this.n)
are undefined. Writing meaningful values to these indices is up to the
caller.
c
- The count of new values that will be appendedpublic void remove(byte v)
BytesModifiable
remove
in interface BytesModifiable
public void ensureCapacity(int minCapacity)
ensureCapacity
in interface BytesModifiable
public void compact()
compact
in interface BytesModifiable
public static byte[] newArray(int oldCapacity, int minNewCapacity)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |