public class View extends AbstractBuffer
Modifier and Type | Class and Description |
---|---|
static class |
View.CaseInsensitive |
Buffer.CaseInsensitve
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile
Constructor and Description |
---|
View() |
View(Buffer buffer) |
View(Buffer buffer,
int mark,
int get,
int put,
int access) |
Modifier and Type | Method and Description |
---|---|
byte[] |
array()
Get the underlying array, if one exists.
|
Buffer |
buffer()
Get the underlying 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) |
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, toString, toString, writeTo
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()
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
valueBuffer.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
valueBuffer.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
valueBuffer.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
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.