|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.io.AbstractBuffer org.mortbay.io.View
public class View
A View on another buffer. Allows operations that do not change the _content or indexes of the backing buffer.
Nested Class Summary | |
---|---|
static class |
View.CaseInsensitive
|
Nested classes/interfaces inherited from interface org.mortbay.io.Buffer |
---|
Buffer.CaseInsensitve |
Field Summary |
---|
Fields inherited from class org.mortbay.io.AbstractBuffer |
---|
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile |
Fields inherited from interface org.mortbay.io.Buffer |
---|
IMMUTABLE, NON_VOLATILE, READONLY, READWRITE, VOLATILE |
Constructor Summary | |
---|---|
View()
|
|
View(Buffer buffer)
|
|
View(Buffer buffer,
int mark,
int get,
int put,
int access)
|
Method Summary | |
---|---|
byte[] |
array()
Get the underlying array, if one exists. |
Buffer |
buffer()
Get the unerlying buffer. |
int |
capacity()
The capacity of the buffer. |
void |
clear()
Clear the buffer. |
void |
compact()
Compact the buffer by discarding bytes before the postion (or mark if set). |
boolean |
equals(Object obj)
|
boolean |
isReadOnly()
|
boolean |
isVolatile()
|
byte |
peek(int index)
Get the byte at a specific index in the buffer. |
int |
peek(int index,
byte[] b,
int offset,
int length)
|
Buffer |
peek(int index,
int length)
|
int |
poke(int index,
Buffer src)
Put the contents of the buffer at the specific index. |
void |
poke(int index,
byte b)
Put a specific byte to a specific getIndex. |
int |
poke(int index,
byte[] b,
int offset,
int length)
Put a specific byte to a specific getIndex. |
String |
toString()
|
void |
update(Buffer buffer)
Update view to buffer |
void |
update(int get,
int put)
|
Methods inherited from class org.mortbay.io.AbstractBuffer |
---|
asArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, duplicate, equalsIgnoreCase, get, get, get, getIndex, hasContent, hashCode, isImmutable, length, mark, mark, markIndex, peek, put, put, put, put, putIndex, readFrom, reset, rewind, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, space, toDebugString, toDetailString, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public View(Buffer buffer, int mark, int get, int put, int access)
buffer
- The Buffer
on which we are presenting a View
.mark
- The initial value of the mark index
get
- The initial value of the get index
put
- The initial value of the put index
access
- The access level - one of the constants from Buffer
.public View(Buffer buffer)
public View()
Method Detail |
---|
public void update(Buffer buffer)
public void update(int get, int put)
public byte[] array()
Buffer
Buffer.array()
from the underlying buffer.public Buffer buffer()
Buffer
buffer
in interface Buffer
buffer
in class AbstractBuffer
Buffer.buffer()
from the underlying buffer.public int capacity()
Buffer
Buffer.capacity()
of the underlying buffer.public void clear()
Buffer
clear
in interface Buffer
clear
in class AbstractBuffer
public void compact()
Buffer
compact
in interface Buffer
compact
in class AbstractBuffer
public boolean equals(Object obj)
equals
in class AbstractBuffer
public boolean isReadOnly()
isReadOnly
in interface Buffer
isReadOnly
in class AbstractBuffer
read only
public boolean isVolatile()
isVolatile
in interface Buffer
isVolatile
in class AbstractBuffer
volatile
public byte peek(int index)
Buffer
index
- an int
value
Buffer.peek(int)
on the underlying bufferpublic int peek(int index, byte[] b, int offset, int length)
index
- an int
valueb
- The byte array to peek intooffset
- The offset into the array to start peekinglength
- an int
value
Buffer.peek(int, byte[], int, int)
on the underlying bufferpublic Buffer peek(int index, int length)
peek
in interface Buffer
peek
in class AbstractBuffer
index
- an int
valuelength
- an int
value
Buffer.peek(int, int)
on the underlying bufferpublic int poke(int index, Buffer src)
Buffer
poke
in interface Buffer
poke
in class AbstractBuffer
index
- src
-
public void poke(int index, byte b)
Buffer
index
- b
- public int poke(int index, byte[] b, int offset, int length)
Buffer
poke
in interface Buffer
poke
in class AbstractBuffer
index
- b
- offset
- length
-
public String toString()
toString
in class AbstractBuffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |