本文整理汇总了Java中java.nio.BufferUnderflowException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java BufferUnderflowException.getMessage方法的具体用法?Java BufferUnderflowException.getMessage怎么用?Java BufferUnderflowException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.nio.BufferUnderflowException
的用法示例。
在下文中一共展示了BufferUnderflowException.getMessage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFully
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public void readFully(byte b[], int off, int len) throws IOException {
try {
bb.get(b, off, len);
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例2: readBoolean
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public boolean readBoolean() throws IOException {
try {
int ch = bb.get();
return (ch != 0);
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例3: readByte
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public byte readByte() throws IOException {
try {
return bb.get();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例4: readUnsignedByte
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public int readUnsignedByte() throws IOException {
try {
return ((int) bb.get()) & 0xff;
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例5: readShort
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public short readShort() throws IOException {
try {
return bb.getShort();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例6: readUnsignedShort
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public int readUnsignedShort() throws IOException {
try {
return ((int) bb.getShort()) & 0xffff;
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例7: readChar
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public char readChar() throws IOException {
try {
return bb.getChar();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例8: readInt
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public int readInt() throws IOException {
try {
return bb.getInt();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例9: readLong
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public long readLong() throws IOException {
try {
return bb.getLong();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例10: readFloat
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public float readFloat() throws IOException {
try {
return bb.getFloat();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例11: readDouble
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
@Override
public double readDouble() throws IOException {
try {
return bb.getDouble();
} catch (BufferUnderflowException e) {
throw new EOFException(e.getMessage());
}
}
示例12: checkBtreeLeaf
import java.nio.BufferUnderflowException; //导入方法依赖的package包/类
/**
* Check a Btree leaf.
*/
private static <K, V> void checkBtreeLeaf( RecordManager recordManager, BtreeInfo<K, V> btreeInfo,
Map<String, int[]> checkedPages, int nbElems, long revision, ByteBuffer byteBuffer, PageIO[] pageIos )
throws Exception
{
// Read each key and value
for ( int i = 0; i < nbElems; i++ )
{
try
{
// Read the number of values
int nbValues = byteBuffer.getInt();
if ( nbValues < 0 )
{
// This is a sub-btree. Read the offset
long subBtreeOffset = byteBuffer.getLong();
// And process the sub-btree
checkBtree( recordManager, subBtreeOffset, checkedPages );
// Now, process the key
// The key length
byteBuffer.getInt();
// The key itself
btreeInfo.keySerializer.deserialize( byteBuffer );
}
else
{
// just deserialize the keys and values
// The value
byteBuffer.getInt();
btreeInfo.valueSerializer.deserialize( byteBuffer );
// the key
byteBuffer.getInt();
btreeInfo.keySerializer.deserialize( byteBuffer );
}
}
catch ( BufferUnderflowException bue )
{
throw new InvalidBTreeException( "The BOB leaf byte buffer is too short : " + bue.getMessage() );
}
}
}