public abstract class BlobDataInputStream extends DataInputStream
InputBlobWritable.getInputStream() 接口获得该对象。
BlobDataInputStream 继承自 DataInputStream,提供了 DataInput的实现。
代码示例:
BlobDataInputStream in = inputBlobWritable.getInputStream(); 使用in.read读取字节数组 使用in.readType读取java基本数据类型 in.close();
| Modifier and Type | Class and Description |
|---|---|
static class |
BlobDataInputStream.SeekFlag
BlobDataInputStream在seek时的位置标志
|
| Constructor and Description |
|---|
BlobDataInputStream(InputStream in)
构建BlobDataInputStream对象
|
| Modifier and Type | Method and Description |
|---|---|
abstract long |
getPos()
获取当前位置
|
abstract int |
read(long position,
byte[] buffer,
int offset,
int length)
从指定位置读取指定长度的字节
|
abstract void |
readFully(long position,
byte[] buffer)
从指定读取字节,填充满buffer传存
|
abstract void |
readFully(long position,
byte[] buffer,
int offset,
int length)
从指定位置读取length个字节
|
abstract void |
seek(long offset,
BlobDataInputStream.SeekFlag seekFlag)
将BlobDataInputStream的位置定位到指定位置
|
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesavailable, close, mark, markSupported, read, reset, skippublic BlobDataInputStream(InputStream in)
in - 基本的数据输入流public abstract void seek(long offset,
BlobDataInputStream.SeekFlag seekFlag)
throws IOException
offset - 偏移seekFlag - 相对位置IOExceptionpublic abstract long getPos()
throws IOException
IOExceptionpublic abstract int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
position - BlobDataInputStream的绝对位置buffer - 读取的字节要放入的缓存offset - 缓存的其实位置length - 待读取的字节数IOExceptionpublic abstract void readFully(long position,
byte[] buffer,
int offset,
int length)
throws IOException
position - BlobDataInputStream的绝对位置buffer - 读取的字节要放入的缓存offset - 缓存的起始位置length - 待读取的字节数IOException - 剩余的字节数小于length时public abstract void readFully(long position,
byte[] buffer)
throws IOException
position - BlobDataInputStream的绝对位置buffer - 读取的字节要放入的缓存IOException - 剩余的字节数小于传存buffer的长度时Copyright © 2024 Alibaba Cloud Computing. All rights reserved.