com.hankcs.hanlp.corpus.io
类 ByteArray

java.lang.Object
  继承者 com.hankcs.hanlp.corpus.io.ByteArray
直接已知子类:
ByteArrayStream

public class ByteArray
extends Object

对字节数组进行封装,提供方便的读取操作

作者:
hankcs

构造方法摘要
ByteArray(byte[] bytes)
           
 
方法摘要
static ByteArray createByteArray(String path)
          从文件读取一个字节数组
 byte[] getBytes()
          获取全部字节
 int getLength()
           
 int getOffset()
           
 boolean hasMore()
           
 byte nextByte()
          读取一个字节
 char nextChar()
          读取一个char,对应于writeChar
 double nextDouble()
           
 float nextFloat()
           
 int nextInt()
          读取一个int
 String nextString()
          读取一个String,注意这个String是双字节版的,在字符之前有一个整型表示长度
 int nextUnsignedShort()
          读取一个无符号短整型
 String nextUTF()
          读取一个UTF字符串
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ByteArray

public ByteArray(byte[] bytes)
方法详细信息

createByteArray

public static ByteArray createByteArray(String path)
从文件读取一个字节数组

参数:
path -
返回:

getBytes

public byte[] getBytes()
获取全部字节

返回:

nextInt

public int nextInt()
读取一个int

返回:

nextDouble

public double nextDouble()

nextChar

public char nextChar()
读取一个char,对应于writeChar

返回:

nextByte

public byte nextByte()
读取一个字节

返回:

hasMore

public boolean hasMore()

nextString

public String nextString()
读取一个String,注意这个String是双字节版的,在字符之前有一个整型表示长度

返回:

nextFloat

public float nextFloat()

nextUnsignedShort

public int nextUnsignedShort()
读取一个无符号短整型

返回:

nextUTF

public String nextUTF()
读取一个UTF字符串

返回:

getOffset

public int getOffset()

getLength

public int getLength()


Copyright © 2014–2015 鐮佸啘鍦�/a>. All rights reserved.