/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the typed bytes as a Java object. */ public Object getValue() { try { ByteArrayInputStream bais = new ByteArrayInputStream(getBytes()); TypedBytesInput tbi = TypedBytesInput.get(new DataInputStream(bais)); Object obj = tbi.read(); return obj; } catch (IOException e) { throw new RuntimeException(e); } }
public void writeTypedBytes(TypedBytesWritable tbw) throws IOException { out.writeRaw(tbw.getBytes(), 0, tbw.getLength()); }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the typed bytes as a Java object. */ public Object getValue() { try { ByteArrayInputStream bais = new ByteArrayInputStream(getBytes()); TypedBytesInput tbi = TypedBytesInput.get(new DataInputStream(bais)); Object obj = tbi.read(); return obj; } catch (IOException e) { throw new RuntimeException(e); } }
/** Get the typed bytes as a Java object. */ public Object getValue() { try { ByteArrayInputStream bais = new ByteArrayInputStream(getBytes()); TypedBytesInput tbi = TypedBytesInput.get(new DataInputStream(bais)); Object obj = tbi.read(); return obj; } catch (IOException e) { throw new RuntimeException(e); } }
/** Get the typed bytes as a Java object. */ public Object getValue() { try { ByteArrayInputStream bais = new ByteArrayInputStream(getBytes()); TypedBytesInput tbi = TypedBytesInput.get(new DataInputStream(bais)); Object obj = tbi.read(); return obj; } catch (IOException e) { throw new RuntimeException(e); } }
public void writeTypedBytes(TypedBytesWritable tbw) throws IOException { out.writeRaw(tbw.getBytes(), 0, tbw.getLength()); }
public void writeTypedBytes(TypedBytesWritable tbw) throws IOException { out.writeRaw(tbw.getBytes(), 0, tbw.getLength()); }
public void writeTypedBytes(TypedBytesWritable tbw) throws IOException { out.writeRaw(tbw.getBytes(), 0, tbw.getLength()); }