org.elasticsearch.common.io.stream
Class AdapterStreamInput

java.lang.Object
  extended by java.io.InputStream
      extended by org.elasticsearch.common.io.stream.StreamInput
          extended by org.elasticsearch.common.io.stream.AdapterStreamInput
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
HandlesStreamInput

public abstract class AdapterStreamInput
extends StreamInput


Field Summary
protected  StreamInput in
           
 
Constructor Summary
protected AdapterStreamInput()
           
  AdapterStreamInput(StreamInput in)
           
 
Method Summary
 int available()
           
 void close()
          Closes the stream to further operations.
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 byte readByte()
          Reads and returns a single byte.
 void readBytes(byte[] b, int offset, int len)
          Reads a specified number of bytes into an array at the specified offset.
 BytesReference readBytesReference()
          Reads a bytes reference from this stream, might hold an actual reference to the underlying bytes of the stream.
 BytesReference readBytesReference(int length)
          Reads a bytes reference from this stream, might hold an actual reference to the underlying bytes of the stream.
 void readFully(byte[] b)
           
 int readInt()
          Reads four bytes and returns an int.
 long readLong()
          Reads eight bytes and returns a long.
 short readShort()
           
 String readString()
           
 Text readText()
           
 String readUTF()
           
 int readVInt()
          Reads an int stored in variable-length format.
 long readVLong()
          Reads a long stored in variable-length format.
 void reset()
          Resets the stream.
 void reset(StreamInput in)
           
 long skip(long n)
           
 String toString()
           
 
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readBoolean, readDouble, readFloat, readGenericValue, readMap, readOptionalString, readOptionalUTF, readStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

in

protected StreamInput in
Constructor Detail

AdapterStreamInput

protected AdapterStreamInput()

AdapterStreamInput

public AdapterStreamInput(StreamInput in)
Method Detail

reset

public void reset(StreamInput in)

readByte

public byte readByte()
              throws IOException
Description copied from class: StreamInput
Reads and returns a single byte.

Specified by:
readByte in class StreamInput
Throws:
IOException

readBytes

public void readBytes(byte[] b,
                      int offset,
                      int len)
               throws IOException
Description copied from class: StreamInput
Reads a specified number of bytes into an array at the specified offset.

Specified by:
readBytes in class StreamInput
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

readBytesReference

public BytesReference readBytesReference()
                                  throws IOException
Description copied from class: StreamInput
Reads a bytes reference from this stream, might hold an actual reference to the underlying bytes of the stream.

Overrides:
readBytesReference in class StreamInput
Throws:
IOException

readBytesReference

public BytesReference readBytesReference(int length)
                                  throws IOException
Description copied from class: StreamInput
Reads a bytes reference from this stream, might hold an actual reference to the underlying bytes of the stream.

Overrides:
readBytesReference in class StreamInput
Throws:
IOException

reset

public void reset()
           throws IOException
Description copied from class: StreamInput
Resets the stream.

Specified by:
reset in class StreamInput
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: StreamInput
Closes the stream to further operations.

Specified by:
close in interface Closeable
Specified by:
close in class StreamInput
Throws:
IOException

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

readFully

public void readFully(byte[] b)
               throws IOException
Overrides:
readFully in class StreamInput
Throws:
IOException

readShort

public short readShort()
                throws IOException
Overrides:
readShort in class StreamInput
Throws:
IOException

readInt

public int readInt()
            throws IOException
Description copied from class: StreamInput
Reads four bytes and returns an int.

Overrides:
readInt in class StreamInput
Throws:
IOException

readVInt

public int readVInt()
             throws IOException
Description copied from class: StreamInput
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Overrides:
readVInt in class StreamInput
Throws:
IOException

readLong

public long readLong()
              throws IOException
Description copied from class: StreamInput
Reads eight bytes and returns a long.

Overrides:
readLong in class StreamInput
Throws:
IOException

readVLong

public long readVLong()
               throws IOException
Description copied from class: StreamInput
Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Overrides:
readVLong in class StreamInput
Throws:
IOException

readUTF

public String readUTF()
               throws IOException
Overrides:
readUTF in class StreamInput
Throws:
IOException

readString

public String readString()
                  throws IOException
Overrides:
readString in class StreamInput
Throws:
IOException

readText

public Text readText()
              throws IOException
Overrides:
readText in class StreamInput
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.