org.elasticsearch.common.io.stream
Class AdapterStreamOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by org.elasticsearch.common.io.stream.StreamOutput
          extended by org.elasticsearch.common.io.stream.AdapterStreamOutput
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
HandlesStreamOutput

public class AdapterStreamOutput
extends StreamOutput


Field Summary
protected  StreamOutput out
           
 
Constructor Summary
AdapterStreamOutput(StreamOutput out)
           
 
Method Summary
 void close()
          Closes this stream to further operations.
 void flush()
          Forces any buffered output to be written.
 long position()
           
 void reset()
           
 void seek(long position)
           
 boolean seekPositionSupported()
           
 void setOut(StreamOutput out)
           
 String toString()
           
 StreamOutput wrappedOut()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeBoolean(boolean b)
          Writes a boolean.
 void writeByte(byte b)
          Writes a single byte.
 void writeBytes(byte[] b)
          Writes an array of bytes.
 void writeBytes(byte[] b, int length)
          Writes an array of bytes.
 void writeBytes(byte[] b, int offset, int length)
          Writes an array of bytes.
 void writeBytesReference(BytesReference bytes)
          Writes the bytes reference, including a length header.
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int i)
          Writes an int as four bytes.
 void writeLong(long i)
          Writes a long as eight bytes.
 void writeString(String str)
           
 void writeText(Text text)
           
 void writeUTF(String str)
          Writes a string.
 void writeVInt(int i)
          Writes an int in a variable-length format.
 void writeVLong(long i)
          Writes an long in a variable-length format.
 
Methods inherited from class org.elasticsearch.common.io.stream.StreamOutput
writeGenericValue, writeMap, writeOptionalString, writeOptionalUTF, writeShort, writeStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

out

protected StreamOutput out
Constructor Detail

AdapterStreamOutput

public AdapterStreamOutput(StreamOutput out)
Method Detail

setOut

public void setOut(StreamOutput out)

wrappedOut

public StreamOutput wrappedOut()

seekPositionSupported

public boolean seekPositionSupported()
Overrides:
seekPositionSupported in class StreamOutput

position

public long position()
              throws IOException
Overrides:
position in class StreamOutput
Throws:
IOException

seek

public void seek(long position)
          throws IOException
Overrides:
seek in class StreamOutput
Throws:
IOException

writeByte

public void writeByte(byte b)
               throws IOException
Description copied from class: StreamOutput
Writes a single byte.

Specified by:
writeByte in class StreamOutput
Throws:
IOException

writeBytes

public void writeBytes(byte[] b,
                       int offset,
                       int length)
                throws IOException
Description copied from class: StreamOutput
Writes an array of bytes.

Specified by:
writeBytes in class StreamOutput
Parameters:
b - the bytes to write
offset - the offset in the byte array
length - the number of bytes to write
Throws:
IOException

flush

public void flush()
           throws IOException
Description copied from class: StreamOutput
Forces any buffered output to be written.

Specified by:
flush in interface Flushable
Specified by:
flush in class StreamOutput
Throws:
IOException

close

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

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

reset

public void reset()
           throws IOException
Specified by:
reset in class StreamOutput
Throws:
IOException

writeBytes

public void writeBytes(byte[] b)
                throws IOException
Description copied from class: StreamOutput
Writes an array of bytes.

Overrides:
writeBytes in class StreamOutput
Parameters:
b - the bytes to write
Throws:
IOException

writeBytes

public void writeBytes(byte[] b,
                       int length)
                throws IOException
Description copied from class: StreamOutput
Writes an array of bytes.

Overrides:
writeBytes in class StreamOutput
Parameters:
b - the bytes to write
length - the number of bytes to write
Throws:
IOException

writeBytesReference

public void writeBytesReference(@Nullable
                                BytesReference bytes)
                         throws IOException
Description copied from class: StreamOutput
Writes the bytes reference, including a length header.

Overrides:
writeBytesReference in class StreamOutput
Throws:
IOException

writeInt

public void writeInt(int i)
              throws IOException
Description copied from class: StreamOutput
Writes an int as four bytes.

Overrides:
writeInt in class StreamOutput
Throws:
IOException

writeVInt

public void writeVInt(int i)
               throws IOException
Description copied from class: StreamOutput
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Overrides:
writeVInt in class StreamOutput
Throws:
IOException

writeLong

public void writeLong(long i)
               throws IOException
Description copied from class: StreamOutput
Writes a long as eight bytes.

Overrides:
writeLong in class StreamOutput
Throws:
IOException

writeVLong

public void writeVLong(long i)
                throws IOException
Description copied from class: StreamOutput
Writes an long in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Overrides:
writeVLong in class StreamOutput
Throws:
IOException

writeUTF

public void writeUTF(String str)
              throws IOException
Description copied from class: StreamOutput
Writes a string.

Overrides:
writeUTF in class StreamOutput
Throws:
IOException

writeString

public void writeString(String str)
                 throws IOException
Overrides:
writeString in class StreamOutput
Throws:
IOException

writeText

public void writeText(Text text)
               throws IOException
Overrides:
writeText in class StreamOutput
Throws:
IOException

writeFloat

public void writeFloat(float v)
                throws IOException
Overrides:
writeFloat in class StreamOutput
Throws:
IOException

writeDouble

public void writeDouble(double v)
                 throws IOException
Overrides:
writeDouble in class StreamOutput
Throws:
IOException

writeBoolean

public void writeBoolean(boolean b)
                  throws IOException
Description copied from class: StreamOutput
Writes a boolean.

Overrides:
writeBoolean in class StreamOutput
Throws:
IOException

write

public void write(int b)
           throws IOException
Overrides:
write in class StreamOutput
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class StreamOutput
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.