Class FileWriteOutBytes
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.druid.segment.writeout.WriteOutBytes
-
- org.apache.druid.segment.writeout.FileWriteOutBytes
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Channel,WritableByteChannel
public final class FileWriteOutBytes extends WriteOutBytes
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamasInputStream()Creates a finiteInputStreamwith the bytes that are written to this WriteOutBytes so far.voidflush()booleanisOpen()voidreadFully(long pos, ByteBuffer buffer)Reads bytes from the byte sequences, represented by this WriteOutBytes, at the random position, into the given buffer.longsize()Returns the number of bytes written to this WriteOutBytes so far.voidwrite(byte[] b, int off, int len)voidwrite(int b)intwrite(ByteBuffer src)voidwriteInt(int v)Writes 4 bytes of the given value in big-endian order, i.voidwriteTo(WritableByteChannel channel)Takes all bytes that are written to this WriteOutBytes so far and writes them into the given channel.-
Methods inherited from class org.apache.druid.segment.writeout.WriteOutBytes
close
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Method Detail
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOExceptionDescription copied from class:WriteOutBytesWrites 4 bytes of the given value in big-endian order, i. e. similar toDataOutput.writeInt(int).- Specified by:
writeIntin classWriteOutBytes- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classWriteOutBytes- Throws:
IOException
-
size
public long size()
Description copied from class:WriteOutBytesReturns the number of bytes written to this WriteOutBytes so far.- Specified by:
sizein classWriteOutBytes
-
writeTo
public void writeTo(WritableByteChannel channel) throws IOException
Description copied from class:WriteOutBytesTakes all bytes that are written to this WriteOutBytes so far and writes them into the given channel.- Specified by:
writeToin classWriteOutBytes- Throws:
IOException
-
readFully
public void readFully(long pos, ByteBuffer buffer) throws IOExceptionDescription copied from class:WriteOutBytesReads bytes from the byte sequences, represented by this WriteOutBytes, at the random position, into the given buffer.- Specified by:
readFullyin classWriteOutBytes- Throws:
IOException
-
asInputStream
public InputStream asInputStream() throws IOException
Description copied from class:WriteOutBytesCreates a finiteInputStreamwith the bytes that are written to this WriteOutBytes so far. The returned InputStream must be closed properly after it's used up.- Specified by:
asInputStreamin classWriteOutBytes- Throws:
IOException
-
isOpen
public boolean isOpen()
-
-