org.elasticsearch.common.io.stream
Class StreamInput

java.lang.Object
  extended by java.io.InputStream
      extended by org.elasticsearch.common.io.stream.StreamInput
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
BytesStreamInput, ChannelBufferStreamInput, HandlesStreamInput, InputStreamStreamInput, LZFStreamInput

public abstract class StreamInput
extends java.io.InputStream


Field Summary
protected  char[] chararr
           
 
Constructor Summary
StreamInput()
           
 
Method Summary
abstract  void close()
          Closes the stream to further operations.
 boolean readBoolean()
          Reads a boolean.
abstract  byte readByte()
          Reads and returns a single byte.
abstract  void readBytes(byte[] b, int offset, int len)
          Reads a specified number of bytes into an array at the specified offset.
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 int readInt()
          Reads four bytes and returns an int.
 long readLong()
          Reads eight bytes and returns a long.
 short readShort()
           
 java.lang.String readUTF()
           
 int readVInt()
          Reads an int stored in variable-length format.
 long readVLong()
          Reads a long stored in variable-length format.
abstract  void reset()
          Resets the stream.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chararr

protected char[] chararr
Constructor Detail

StreamInput

public StreamInput()
Method Detail

readByte

public abstract byte readByte()
                       throws java.io.IOException
Reads and returns a single byte.

Throws:
java.io.IOException

readBytes

public abstract void readBytes(byte[] b,
                               int offset,
                               int len)
                        throws java.io.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:
java.io.IOException

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Reads four bytes and returns an int.

Throws:
java.io.IOException

readVInt

public int readVInt()
             throws java.io.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:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Reads eight bytes and returns a long.

Throws:
java.io.IOException

readVLong

public long readVLong()
               throws java.io.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:
java.io.IOException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Throws:
java.io.IOException

readFloat

public final float readFloat()
                      throws java.io.IOException
Throws:
java.io.IOException

readDouble

public final double readDouble()
                        throws java.io.IOException
Throws:
java.io.IOException

readBoolean

public final boolean readBoolean()
                          throws java.io.IOException
Reads a boolean.

Throws:
java.io.IOException

reset

public abstract void reset()
                    throws java.io.IOException
Resets the stream.

Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

close

public abstract void close()
                    throws java.io.IOException
Closes the stream to further operations.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException