org.eclipse.jetty.io
类 ByteArrayBuffer

java.lang.Object
  继承者 org.eclipse.jetty.io.AbstractBuffer
      继承者 org.eclipse.jetty.io.ByteArrayBuffer
所有已实现的接口:
Cloneable, Buffer
直接已知子类:
ByteArrayBuffer.CaseInsensitive, IndirectNIOBuffer

public class ByteArrayBuffer
extends AbstractBuffer


嵌套类摘要
static class ByteArrayBuffer.CaseInsensitive
           
 
从接口 org.eclipse.jetty.io.Buffer 继承的嵌套类/接口
Buffer.CaseInsensitve
 
字段摘要
protected  byte[] _bytes
           
 
从类 org.eclipse.jetty.io.AbstractBuffer 继承的字段
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile
 
从接口 org.eclipse.jetty.io.Buffer 继承的字段
IMMUTABLE, NON_VOLATILE, READONLY, READWRITE, VOLATILE
 
构造方法摘要
  ByteArrayBuffer(byte[] bytes)
           
  ByteArrayBuffer(byte[] bytes, int index, int length)
           
  ByteArrayBuffer(byte[] bytes, int index, int length, int access)
           
  ByteArrayBuffer(byte[] bytes, int index, int length, int access, boolean isVolatile)
           
  ByteArrayBuffer(int size)
           
protected ByteArrayBuffer(int size, int access, boolean isVolatile)
           
  ByteArrayBuffer(String value)
           
  ByteArrayBuffer(String value, boolean immutable)
           
  ByteArrayBuffer(String value, String encoding)
           
 
方法摘要
 byte[] array()
          Get the underlying array, if one exists.
 int capacity()
          The capacity of the buffer.
 void compact()
          Compact the buffer by discarding bytes before the postion (or mark if set).
 boolean equals(Object obj)
           
 boolean equalsIgnoreCase(Buffer b)
           
 byte get()
          Get the byte at the current getIndex and increment it.
 int hashCode()
           
 byte peek(int index)
          Get the byte at a specific index in the buffer.
 int peek(int index, byte[] b, int offset, 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.
 int readFrom(InputStream in, int max)
          Read the buffer's contents from the input stream
 int space()
          the space remaining in the buffer.
 void writeTo(OutputStream out)
          Write the buffer's contents to the output stream
 
从类 org.eclipse.jetty.io.AbstractBuffer 继承的方法
asArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, buffer, clear, duplicate, get, get, getIndex, hasContent, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, rewind, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, toDebugString, toDetailString, toString, toString, toString
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

_bytes

protected final byte[] _bytes
构造方法详细信息

ByteArrayBuffer

protected ByteArrayBuffer(int size,
                          int access,
                          boolean isVolatile)

ByteArrayBuffer

public ByteArrayBuffer(byte[] bytes)

ByteArrayBuffer

public ByteArrayBuffer(byte[] bytes,
                       int index,
                       int length)

ByteArrayBuffer

public ByteArrayBuffer(byte[] bytes,
                       int index,
                       int length,
                       int access)

ByteArrayBuffer

public ByteArrayBuffer(byte[] bytes,
                       int index,
                       int length,
                       int access,
                       boolean isVolatile)

ByteArrayBuffer

public ByteArrayBuffer(int size)

ByteArrayBuffer

public ByteArrayBuffer(String value)

ByteArrayBuffer

public ByteArrayBuffer(String value,
                       boolean immutable)

ByteArrayBuffer

public ByteArrayBuffer(String value,
                       String encoding)
                throws UnsupportedEncodingException
抛出:
UnsupportedEncodingException
方法详细信息

array

public byte[] array()
从接口 Buffer 复制的描述
Get the underlying array, if one exists.

返回:
a byte[] backing this buffer or null if none exists.

capacity

public int capacity()
从接口 Buffer 复制的描述
The capacity of the buffer. This is the maximum putIndex that may be set.

返回:
an int value

compact

public void compact()
从接口 Buffer 复制的描述
Compact the buffer by discarding bytes before the postion (or mark if set). Bytes from the getIndex (or mark) to the putIndex are moved to the beginning of the buffer and the values adjusted accordingly.

指定者:
接口 Buffer 中的 compact
覆盖:
AbstractBuffer 中的 compact

equals

public boolean equals(Object obj)
覆盖:
AbstractBuffer 中的 equals

equalsIgnoreCase

public boolean equalsIgnoreCase(Buffer b)
指定者:
接口 Buffer 中的 equalsIgnoreCase
覆盖:
AbstractBuffer 中的 equalsIgnoreCase
返回:
a boolean value true if case sensitive comparison on this buffer

get

public byte get()
从接口 Buffer 复制的描述
Get the byte at the current getIndex and increment it.

指定者:
接口 Buffer 中的 get
覆盖:
AbstractBuffer 中的 get
返回:
The byte value from the current getIndex.

hashCode

public int hashCode()
覆盖:
AbstractBuffer 中的 hashCode

peek

public byte peek(int index)
从接口 Buffer 复制的描述
Get the byte at a specific index in the buffer.

参数:
index - an int value
返回:
a byte value

peek

public int peek(int index,
                byte[] b,
                int offset,
                int length)
参数:
index - an int value
b - The byte array to peek into
offset - The offset into the array to start peeking
length - an int value
返回:
The number of bytes actually peeked

poke

public void poke(int index,
                 byte b)
从接口 Buffer 复制的描述
Put a specific byte to a specific getIndex.

参数:
index - an int value
b - a byte value

poke

public int poke(int index,
                Buffer src)
从接口 Buffer 复制的描述
Put the contents of the buffer at the specific index.

指定者:
接口 Buffer 中的 poke
覆盖:
AbstractBuffer 中的 poke
参数:
index - an int value
src - a Buffer. If the source buffer is not modified
返回:
The number of bytes actually poked

poke

public int poke(int index,
                byte[] b,
                int offset,
                int length)
从接口 Buffer 复制的描述
Put a specific byte to a specific getIndex.

指定者:
接口 Buffer 中的 poke
覆盖:
AbstractBuffer 中的 poke
参数:
index - an int value
b - a byte array value
返回:
The number of bytes actually poked

writeTo

public void writeTo(OutputStream out)
             throws IOException
从接口 Buffer 复制的描述
Write the buffer's contents to the output stream

指定者:
接口 Buffer 中的 writeTo
覆盖:
AbstractBuffer 中的 writeTo
抛出:
IOException

readFrom

public int readFrom(InputStream in,
                    int max)
             throws IOException
从接口 Buffer 复制的描述
Read the buffer's contents from the input stream

指定者:
接口 Buffer 中的 readFrom
覆盖:
AbstractBuffer 中的 readFrom
参数:
in - input stream
max - maximum number of bytes that may be read
返回:
actual number of bytes read or -1 for EOF
抛出:
IOException

space

public int space()
从接口 Buffer 复制的描述
the space remaining in the buffer.

指定者:
接口 Buffer 中的 space
覆盖:
AbstractBuffer 中的 space
返回:
capacity - putIndex


Copyright © 2013. All Rights Reserved.