org.eclipse.jetty.io.nio
类 DirectNIOBuffer

java.lang.Object
  继承者 org.eclipse.jetty.io.AbstractBuffer
      继承者 org.eclipse.jetty.io.nio.DirectNIOBuffer
所有已实现的接口:
Cloneable, Buffer, NIOBuffer

public class DirectNIOBuffer
extends AbstractBuffer
implements NIOBuffer


嵌套类摘要
 
从接口 org.eclipse.jetty.io.Buffer 继承的嵌套类/接口
Buffer.CaseInsensitve
 
字段摘要
protected  ByteBuffer _buf
           
 
从类 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
 
构造方法摘要
DirectNIOBuffer(ByteBuffer buffer, boolean immutable)
           
DirectNIOBuffer(File file)
           
DirectNIOBuffer(int size)
           
 
方法摘要
 byte[] array()
          Get the underlying array, if one exists.
 int capacity()
          The capacity of the buffer.
 ByteBuffer getByteBuffer()
           
 boolean isDirect()
           
 byte peek(int position)
          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
 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, compact, duplicate, equals, equalsIgnoreCase, get, get, get, getIndex, hasContent, hashCode, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, rewind, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, space, toDebugString, toDetailString, toString, toString, toString
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
从接口 org.eclipse.jetty.io.Buffer 继承的方法
asArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, buffer, clear, compact, equalsIgnoreCase, get, get, get, getIndex, hasContent, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, space, toDetailString, toString, toString
 

字段详细信息

_buf

protected final ByteBuffer _buf
构造方法详细信息

DirectNIOBuffer

public DirectNIOBuffer(int size)

DirectNIOBuffer

public DirectNIOBuffer(ByteBuffer buffer,
                       boolean immutable)

DirectNIOBuffer

public DirectNIOBuffer(File file)
                throws IOException
参数:
file -
抛出:
IOException
方法详细信息

isDirect

public boolean isDirect()
指定者:
接口 NIOBuffer 中的 isDirect

array

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

指定者:
接口 Buffer 中的 array
返回:
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.

指定者:
接口 Buffer 中的 capacity
返回:
an int value

peek

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

指定者:
接口 Buffer 中的 peek
参数:
position - an int value
返回:
a byte value

peek

public int peek(int index,
                byte[] b,
                int offset,
                int length)
指定者:
接口 Buffer 中的 peek
参数:
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.

指定者:
接口 Buffer 中的 poke
参数:
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

getByteBuffer

public ByteBuffer getByteBuffer()
指定者:
接口 NIOBuffer 中的 getByteBuffer

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

writeTo

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

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


Copyright © 2013. All Rights Reserved.