List of usage examples for org.apache.hadoop.typedbytes TypedBytesInput readVector
@SuppressWarnings("unchecked") public ArrayList readVector() throws IOException
Type.VECTOR
code. From source file:fm.last.pigtail.storage.TypedBytesSequenceFileLoader.java
License:Apache License
@Override public Tuple bytesToTuple(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.VECTOR) { throw new FrontendException("Type code does not correspond to vector."); }//from w w w . j ava2 s .co m Tuple result = tupleFactory.newTuple(); for (Object item : tbin.readVector()) { result.append(item); } return result; }