public abstract class ByteBuf extends Object
| Constructor and Description |
|---|
ByteBuf() |
| Modifier and Type | Method and Description |
|---|---|
static ByteBuf |
allocate(byte[] data) |
static ByteBuf |
allocate(int capacity) |
abstract ByteBuffer |
asByteBuffer()
将缓冲区中的内容作为ByteBuffer缓冲区
|
abstract ByteArrayInputStream |
asInputStream()
将缓冲区中的内容作为输入流
|
abstract String |
asString(String charset)
将所有内容作为字符串输出
|
abstract ByteBuf |
autoExpand(boolean autoExpand) |
abstract boolean |
bigEndian() |
abstract ByteBuf |
bigEndian(boolean bigEndian) |
abstract int |
capacity() |
abstract ByteBuf |
capacity(int newCapacity) |
abstract ByteBuf |
clear() |
abstract ByteBuf |
get(byte[] data) |
abstract ByteBuf |
get(ByteBuffer buffer) |
abstract byte |
getByte() |
abstract byte[] |
getBytes() |
abstract byte[] |
getBytes(int length) |
abstract double |
getDouble() |
abstract float |
getFloat() |
abstract int |
getInt() |
abstract long |
getLong() |
abstract short |
getShort() |
abstract String |
getString(String charset,
int length) |
abstract boolean |
isAutoExpand() |
abstract boolean |
isReadOnly() |
abstract int |
maxCapacity() |
abstract ByteBuf |
put(byte v) |
abstract ByteBuf |
put(byte[] v) |
abstract ByteBuf |
put(ByteBuffer buffer) |
abstract ByteBuf |
put(double v) |
abstract ByteBuf |
put(float v) |
abstract ByteBuf |
put(int v) |
abstract ByteBuf |
put(long v) |
abstract ByteBuf |
put(short v) |
abstract ByteBuf |
put(String charset,
String... strings) |
abstract int |
read(InputStream is)
从输入流读取
|
abstract int |
readableLength() |
abstract ByteBuf |
readOnly(boolean readOnly) |
abstract ByteBuf |
resetRead()
重置读指针
|
abstract int |
writableLength() |
abstract int |
write(OutputStream os)
向输出流写入
|
public static ByteBuf allocate(int capacity)
public static ByteBuf allocate(byte[] data)
public abstract boolean bigEndian()
public abstract ByteBuf bigEndian(boolean bigEndian)
public abstract int capacity()
public abstract ByteBuf capacity(int newCapacity)
public abstract int maxCapacity()
public abstract boolean isAutoExpand()
public abstract ByteBuf autoExpand(boolean autoExpand)
public abstract boolean isReadOnly()
public abstract ByteBuf readOnly(boolean readOnly)
public abstract ByteBuf clear()
public abstract ByteBuf put(byte v)
public abstract ByteBuf put(short v)
public abstract ByteBuf put(int v)
public abstract ByteBuf put(long v)
public abstract ByteBuf put(float v)
public abstract ByteBuf put(double v)
public abstract ByteBuf put(byte[] v)
public abstract ByteBuf put(ByteBuffer buffer)
public abstract ByteBuf get(byte[] data)
public abstract ByteBuf resetRead()
public abstract ByteBuffer asByteBuffer()
public abstract ByteArrayInputStream asInputStream()
public abstract int read(InputStream is) throws IOException
is - 输入流IOException - 异常public abstract int write(OutputStream os) throws IOException
os - 输入流IOException - 异常public abstract ByteBuf get(ByteBuffer buffer)
public abstract String asString(String charset)
charset - 字符集public abstract byte getByte()
public abstract short getShort()
public abstract int getInt()
public abstract long getLong()
public abstract float getFloat()
public abstract double getDouble()
public abstract byte[] getBytes()
public abstract byte[] getBytes(int length)
public abstract int readableLength()
public abstract int writableLength()
Copyright © 2018. All rights reserved.