org.apache.gora.hbase.util
Class HBaseByteInterface

java.lang.Object
  extended by org.apache.gora.hbase.util.HBaseByteInterface

public class HBaseByteInterface
extends Object

Contains utility methods for byte[] <-> field conversions.


Nested Class Summary
static class HBaseByteInterface.BinaryEncoderWithStream
          A BinaryEncoder that exposes the outputstream so that it can be reset every time.
 
Field Summary
static ThreadLocal<org.apache.avro.io.BinaryDecoder> decoders
          Threadlocals maintaining reusable binary decoders and encoders.
static ThreadLocal<HBaseByteInterface.BinaryEncoderWithStream> encoders
           
static ThreadLocal<Map<String,org.apache.avro.specific.SpecificDatumReader<?>>> readerMaps
           
static ThreadLocal<Map<String,org.apache.avro.specific.SpecificDatumWriter<?>>> writerMaps
           
 
Constructor Summary
HBaseByteInterface()
           
 
Method Summary
static
<K> K
fromBytes(Class<K> clazz, byte[] val)
           
static Object fromBytes(org.apache.avro.Schema schema, byte[] val)
           
static byte[] toBytes(Object o)
           
static byte[] toBytes(Object o, org.apache.avro.Schema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoders

public static final ThreadLocal<org.apache.avro.io.BinaryDecoder> decoders
Threadlocals maintaining reusable binary decoders and encoders.


encoders

public static final ThreadLocal<HBaseByteInterface.BinaryEncoderWithStream> encoders

readerMaps

public static final ThreadLocal<Map<String,org.apache.avro.specific.SpecificDatumReader<?>>> readerMaps

writerMaps

public static final ThreadLocal<Map<String,org.apache.avro.specific.SpecificDatumWriter<?>>> writerMaps
Constructor Detail

HBaseByteInterface

public HBaseByteInterface()
Method Detail

fromBytes

public static Object fromBytes(org.apache.avro.Schema schema,
                               byte[] val)
                        throws IOException
Throws:
IOException

fromBytes

public static <K> K fromBytes(Class<K> clazz,
                              byte[] val)

toBytes

public static byte[] toBytes(Object o)

toBytes

public static byte[] toBytes(Object o,
                             org.apache.avro.Schema schema)
                      throws IOException
Throws:
IOException


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.