Interface TsFileOutput
-
- All Known Implementing Classes:
LocalTsFileOutput
public interface TsFileOutput
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()close the output.voidflush()the same withOutputStream.flush().longgetPosition()gets the current position of the Output.voidtruncate(long size)The same withFileChannel.truncate(long).java.io.OutputStreamwrapAsStream()convert this TsFileOutput as a outputstream.voidwrite(byte b)Writes 1 byte to this output at the current position.voidwrite(byte[] b)Writesb.lengthbytes from the specified byte array to this output at the current position.voidwrite(java.nio.ByteBuffer b)Writesb.remaining()bytes from the specified byte array to this output at the current position.
-
-
-
Method Detail
-
write
void write(byte[] b) throws java.io.IOExceptionWritesb.lengthbytes from the specified byte array to this output at the current position.- Parameters:
b- the data.- Throws:
java.io.IOException- if an I/O error occurs.
-
write
void write(byte b) throws java.io.IOExceptionWrites 1 byte to this output at the current position.- Parameters:
b- the data.- Throws:
java.io.IOException- if an I/O error occurs.
-
write
void write(java.nio.ByteBuffer b) throws java.io.IOExceptionWritesb.remaining()bytes from the specified byte array to this output at the current position.- Parameters:
b- the data.- Throws:
java.io.IOException- if an I/O error occurs.
-
getPosition
long getPosition() throws java.io.IOExceptiongets the current position of the Output. This method is usually used for recording where the data is.
For example, if the Output is a fileOutputStream, then getPosition returns its file position.- Returns:
- current position
- Throws:
java.io.IOException- if an I/O error occurs.
-
close
void close() throws java.io.IOExceptionclose the output.- Throws:
java.io.IOException- if an I/O error occurs.
-
wrapAsStream
java.io.OutputStream wrapAsStream() throws java.io.IOExceptionconvert this TsFileOutput as a outputstream.- Returns:
- an output stream whose position is the same with this Output
- Throws:
java.io.IOException- if an I/O error occurs.
-
flush
void flush() throws java.io.IOExceptionthe same withOutputStream.flush().- Throws:
java.io.IOException- if an I/O error occurs.
-
truncate
void truncate(long size) throws java.io.IOExceptionThe same withFileChannel.truncate(long).- Parameters:
size- size The new size, a non-negative byte count- Throws:
java.io.IOException
-
-