org.elasticsearch.transport.netty
Class ChannelBufferStreamInput

java.lang.Object
  extended by java.io.InputStream
      extended by org.elasticsearch.common.io.stream.StreamInput
          extended by org.elasticsearch.transport.netty.ChannelBufferStreamInput
All Implemented Interfaces:
java.io.Closeable

public class ChannelBufferStreamInput
extends StreamInput

A Netty ChannelBuffer based StreamInput.


Field Summary
 
Fields inherited from class org.elasticsearch.common.io.stream.StreamInput
chararr
 
Constructor Summary
ChannelBufferStreamInput(org.elasticsearch.common.netty.buffer.ChannelBuffer buffer, int length)
           
 
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 off, int len)
           
 byte readByte()
          Reads and returns a single byte.
 int readBytes()
          Returns the number of read bytes by this stream so far.
 void readBytes(byte[] b, int offset, int len)
          Reads a specified number of bytes into an array at the specified offset.
 void reset()
          Resets the stream.
 long skip(long n)
           
 int skipBytes(int n)
           
 
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readBoolean, readDouble, readFloat, readFully, readInt, readLong, readShort, readUTF, readVInt, readVLong
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelBufferStreamInput

public ChannelBufferStreamInput(org.elasticsearch.common.netty.buffer.ChannelBuffer buffer,
                                int length)
Method Detail

readBytes

public int readBytes()
Returns the number of read bytes by this stream so far.


available

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

mark

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

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.InputStream

read

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

read

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

reset

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

Specified by:
reset in class StreamInput
Throws:
java.io.IOException

skip

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

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Throws:
java.io.IOException

readByte

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

Specified by:
readByte in class StreamInput
Throws:
java.io.IOException

readBytes

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

close

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

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