Class OptimizedBinaryDecoder


  • public class OptimizedBinaryDecoder
    extends org.apache.avro.io.BinaryDecoder
    This class is used to optimize bytes field decoding. It will wrap the original byte array as a byte buffer if the field type is 'bytes'(the default behavior in is to create a new byte array copy, which is not efficient. The reason to use package name: org.apache.avro.io since BinaryDecoder(byte[], int, int) is package-visible.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer getRawBytes()  
      java.nio.ByteBuffer readBytes​(java.nio.ByteBuffer old)  
      float readFloat()  
      • Methods inherited from class org.apache.avro.io.BinaryDecoder

        arrayNext, doReadBytes, doReadItemCount, doSkipBytes, inputStream, isEnd, mapNext, readArrayStart, readBoolean, readDouble, readEnum, readFixed, readIndex, readInt, readLong, readMapStart, readNull, readString, readString, skipArray, skipBytes, skipFixed, skipMap, skipString
      • Methods inherited from class org.apache.avro.io.Decoder

        readFixed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readBytes

        public java.nio.ByteBuffer readBytes​(java.nio.ByteBuffer old)
                                      throws java.io.IOException
        Overrides:
        readBytes in class org.apache.avro.io.BinaryDecoder
        Throws:
        java.io.IOException
      • readFloat

        public float readFloat()
                        throws java.io.IOException
        Overrides:
        readFloat in class org.apache.avro.io.BinaryDecoder
        Throws:
        java.io.IOException
      • getRawBytes

        public java.nio.ByteBuffer getRawBytes()