public class LocalTsFileOutput extends OutputStream implements TsFileOutput
| Constructor and Description |
|---|
LocalTsFileOutput(FileOutputStream outputStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close the output.
|
void |
flush()
the same with
OutputStream.flush(). |
long |
getPosition()
gets the current position of the Output.
|
void |
truncate(long size)
The same with
FileChannel.truncate(long). |
OutputStream |
wrapAsStream()
convert this TsFileOutput as a outputstream.
|
void |
write(byte b)
Writes 1 byte to this output at the current position.
|
void |
write(byte[] b)
Writes
b.length bytes from the specified byte array to this output at the current
position. |
void |
write(byte[] buf,
int start,
int offset) |
void |
write(ByteBuffer b)
Writes
b.remaining() bytes from the specified byte array to this output at the
current position. |
void |
write(int b) |
public LocalTsFileOutput(FileOutputStream outputStream)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
TsFileOutputb.length bytes from the specified byte array to this output at the current
position.write in interface TsFileOutputwrite in class OutputStreamb - the data.IOException - if an I/O error occurs.public void write(byte b)
throws IOException
TsFileOutputwrite in interface TsFileOutputb - the data.IOException - if an I/O error occurs.public void write(byte[] buf,
int start,
int offset)
throws IOException
write in class OutputStreamIOExceptionpublic void write(ByteBuffer b) throws IOException
TsFileOutputb.remaining() bytes from the specified byte array to this output at the
current position.write in interface TsFileOutputb - the data.IOException - if an I/O error occurs.public long getPosition()
TsFileOutputgetPosition in interface TsFileOutputpublic void close()
throws IOException
TsFileOutputclose in interface Closeableclose in interface AutoCloseableclose in interface TsFileOutputclose in class OutputStreamIOException - if an I/O error occurs.public OutputStream wrapAsStream()
TsFileOutputwrapAsStream in interface TsFileOutputpublic void flush()
throws IOException
TsFileOutputOutputStream.flush().flush in interface Flushableflush in interface TsFileOutputflush in class OutputStreamIOException - if an I/O error occurs.public void truncate(long size)
throws IOException
TsFileOutputFileChannel.truncate(long).truncate in interface TsFileOutputsize - size The new size, a non-negative byte countIOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.