Example usage for org.apache.hadoop.typedbytes TypedBytesInput readLong

List of usage examples for org.apache.hadoop.typedbytes TypedBytesInput readLong

Introduction

In this page you can find the example usage for org.apache.hadoop.typedbytes TypedBytesInput readLong.

Prototype

public long readLong() throws IOException 

Source Link

Document

Reads the long following a Type.LONG code.

Usage

From source file:fm.last.pigtail.storage.TypedBytesSequenceFileLoader.java

License:Apache License

@Override
public Long bytesToLong(byte[] b) throws IOException {
    ByteArrayInputStream bais = new ByteArrayInputStream(b);
    DataInputStream dis = new DataInputStream(bais);
    TypedBytesInput tbin = TypedBytesInput.get(dis);
    if (tbin.readType() != org.apache.hadoop.typedbytes.Type.LONG) {
        throw new FrontendException("Type code does not correspond to long.");
    }//w w w . j a  v  a 2 s  .co  m
    return tbin.readLong();
}