Class DataInput

    • Constructor Summary

      Constructors 
      Constructor Description
      DataInput()  
    • Constructor Detail

      • DataInput

        public DataInput()
    • Method Detail

      • setModifiedUTF8StringsMode

        public void setModifiedUTF8StringsMode()
        Call this if readString should read characters stored in the old modified UTF8 format (length in java chars and java's modified UTF8 encoding). This is used for indices written pre-2.4 See LUCENE-510 for details.
      • readBytes

        public abstract void readBytes​(byte[] b,
                                       int offset,
                                       int len)
                                throws IOException
        Reads a specified number of bytes into an array at the specified offset.
        Parameters:
        b - the array to read bytes into
        offset - the offset in the array to start storing bytes
        len - the number of bytes to read
        Throws:
        IOException
        See Also:
        DataOutput.writeBytes(byte[],int)
      • readBytes

        public void readBytes​(byte[] b,
                              int offset,
                              int len,
                              boolean useBuffer)
                       throws IOException
        Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.
        Parameters:
        b - the array to read bytes into
        offset - the offset in the array to start storing bytes
        len - the number of bytes to read
        useBuffer - set to false if the caller will handle buffering.
        Throws:
        IOException
        See Also:
        DataOutput.writeBytes(byte[],int)
      • readVInt

        public int readVInt()
                     throws IOException
        Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
        Throws:
        IOException
        See Also:
        DataOutput.writeVInt(int)
      • readVLong

        public long readVLong()
                       throws IOException
        Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.
        Throws:
        IOException
      • readChars

        @Deprecated
        public void readChars​(char[] buffer,
                              int start,
                              int length)
                       throws IOException
        Deprecated.
        -- please use readString or readBytes instead, and construct the string from those utf8 bytes
        Reads Lucene's old "modified UTF-8" encoded characters into an array.
        Parameters:
        buffer - the array to read characters into
        start - the offset in the array to start storing characters
        length - the number of characters to read
        Throws:
        IOException
        See Also:
        DataOutput.writeChars(String,int,int)
      • clone

        public Object clone()
        Returns a clone of this stream.

        Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.

        Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.

        Overrides:
        clone in class Object