org.jboss.netty.buffer
类 BigEndianHeapChannelBuffer

java.lang.Object
  继承者 org.jboss.netty.buffer.AbstractChannelBuffer
      继承者 org.jboss.netty.buffer.HeapChannelBuffer
          继承者 org.jboss.netty.buffer.BigEndianHeapChannelBuffer
所有已实现的接口:
java.lang.Comparable<ChannelBuffer>, ChannelBuffer

public class BigEndianHeapChannelBuffer
extends HeapChannelBuffer

一个big-endian的java堆缓冲. 强烈建议使用ChannelBuffers.buffer(int)ChannelBuffers.wrappedBuffer(byte[])代替调用构造方法


构造方法摘要
BigEndianHeapChannelBuffer(byte[] array)
          使用指定的字节数组创建一个新的big-endian堆缓冲.
BigEndianHeapChannelBuffer(int length)
          使用新分配的字节数组创建一个新的big-endian堆缓冲.
 
方法摘要
 ChannelBuffer copy(int index, int length)
          返回该缓冲的子部分,修改其中任何一个缓冲对另一个都不会有影响.且并不修改该缓冲区的 readerIndexwriterIndex.
 ChannelBuffer duplicate()
          返回该缓冲全部分.修改其中任何一个缓冲对另一个都会有影响,不过它们维护着各自的索引和标记,该方法等同于 buf.slice(0, buf.capacity()).
 ChannelBufferFactory factory()
          返回一个用于创建与这个缓冲相同类型和默认ByteOrderChannelBuffer的工厂.
 int getInt(int index)
          在指定绝对值index处获取一个32位符号整型.该方法并不修改缓冲的 readerIndexwriterIndex.
 long getLong(int index)
          在指定绝对值index处获取一个64位整型.该方法并不修改缓冲的 readerIndexwriterIndex.
 short getShort(int index)
          在指定绝对值index处获取一个16位整型.该方法并不修改缓冲的 readerIndexwriterIndex.
 int getUnsignedMedium(int index)
          在指定绝对值index处获取一个24位无符号整型.该方法并不修改缓冲的 readerIndexwriterIndex.
 java.nio.ByteOrder order()
          返回缓冲区的 字节序.
 void setInt(int index, int value)
          在指定绝对值index处设置指定的32位整型.
 void setLong(int index, long value)
          在指定绝对值index处设置指定的64位长整型.
 void setMedium(int index, int value)
          在指定绝对值index处设置指定的24位整型.
 void setShort(int index, int value)
          在指定绝对值index处设置指定的16位短整型. 16高序位会被忽略.
 
从类 org.jboss.netty.buffer.HeapChannelBuffer 继承的方法
array, arrayOffset, capacity, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, hasArray, isDirect, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, slice, toByteBuffer
 
从类 org.jboss.netty.buffer.AbstractChannelBuffer 继承的方法
bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, clear, compareTo, copy, discardReadBytes, ensureWritableBytes, equals, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getMedium, getUnsignedByte, getUnsignedInt, getUnsignedShort, hashCode, indexOf, indexOf, markReaderIndex, markWriterIndex, readable, readableBytes, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, resetReaderIndex, resetWriterIndex, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setZero, skipBytes, skipBytes, slice, toByteBuffer, toByteBuffers, toByteBuffers, toString, toString, toString, toString, toString, toString, toString, writable, writableBytes, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZero
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

BigEndianHeapChannelBuffer

public BigEndianHeapChannelBuffer(int length)
使用新分配的字节数组创建一个新的big-endian堆缓冲.

参数:
length - 新字节数组长度

BigEndianHeapChannelBuffer

public BigEndianHeapChannelBuffer(byte[] array)
使用指定的字节数组创建一个新的big-endian堆缓冲.

参数:
array - 被封装的字节数组
方法详细信息

factory

public ChannelBufferFactory factory()
从接口 ChannelBuffer 复制的描述
返回一个用于创建与这个缓冲相同类型和默认ByteOrderChannelBuffer的工厂.


order

public java.nio.ByteOrder order()
从接口 ChannelBuffer 复制的描述
返回缓冲区的 字节序.


getShort

public short getShort(int index)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处获取一个16位整型.该方法并不修改缓冲的 readerIndexwriterIndex.


getUnsignedMedium

public int getUnsignedMedium(int index)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处获取一个24位无符号整型.该方法并不修改缓冲的 readerIndexwriterIndex.


getInt

public int getInt(int index)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处获取一个32位符号整型.该方法并不修改缓冲的 readerIndexwriterIndex.


getLong

public long getLong(int index)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处获取一个64位整型.该方法并不修改缓冲的 readerIndexwriterIndex.


setShort

public void setShort(int index,
                     int value)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处设置指定的16位短整型. 16高序位会被忽略. 该方法并不修改该缓冲区的 readerIndexwriterIndex.


setMedium

public void setMedium(int index,
                      int value)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处设置指定的24位整型. 请注意大多数有意义的字节会被忽略. 该方法并不修改该缓冲区的 readerIndexwriterIndex.


setInt

public void setInt(int index,
                   int value)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处设置指定的32位整型. 该方法并不修改该缓冲区的 readerIndexwriterIndex.


setLong

public void setLong(int index,
                    long value)
从接口 ChannelBuffer 复制的描述
在指定绝对值index处设置指定的64位长整型. 该方法并不修改该缓冲区的 readerIndexwriterIndex.


duplicate

public ChannelBuffer duplicate()
从接口 ChannelBuffer 复制的描述
返回该缓冲全部分.修改其中任何一个缓冲对另一个都会有影响,不过它们维护着各自的索引和标记,该方法等同于 buf.slice(0, buf.capacity()). 且并不修改该缓冲区的 readerIndexwriterIndex.


copy

public ChannelBuffer copy(int index,
                          int length)
从接口 ChannelBuffer 复制的描述
返回该缓冲的子部分,修改其中任何一个缓冲对另一个都不会有影响.且并不修改该缓冲区的 readerIndexwriterIndex.