public abstract class OutputStream extends Object
Directory,
InputStream| Constructor and Description |
|---|
OutputStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream to further operations.
|
protected void |
flush()
Forces any buffered output to be written.
|
protected abstract void |
flushBuffer(byte[] b,
int len)
Expert: implements buffer write.
|
long |
getFilePointer()
Returns the current position in this file, where the next write will
occur.
|
abstract long |
length()
The number of bytes in the file.
|
void |
seek(long pos)
Sets current position in this file, where the next write will occur.
|
void |
writeByte(byte b)
Writes a single byte.
|
void |
writeBytes(byte[] b,
int length)
Writes an array of bytes.
|
void |
writeChars(String s,
int start,
int length)
Writes a sequence of UTF-8 encoded characters from a string.
|
void |
writeInt(int i)
Writes an int as four bytes.
|
void |
writeLong(long i)
Writes a long as eight bytes.
|
void |
writeString(String s)
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.
|
public final void writeByte(byte b)
throws IOException
IOExceptionInputStream.readByte()public final void writeBytes(byte[] b,
int length)
throws IOException
b - the bytes to writelength - the number of bytes to writeIOExceptionInputStream.readBytes(byte[],int,int)public final void writeInt(int i)
throws IOException
IOExceptionInputStream.readInt()public final void writeVInt(int i)
throws IOException
IOExceptionInputStream.readVInt()public final void writeLong(long i)
throws IOException
IOExceptionInputStream.readLong()public final void writeVLong(long i)
throws IOException
IOExceptionInputStream.readVLong()public final void writeString(String s) throws IOException
IOExceptionInputStream.readString()public final void writeChars(String s, int start, int length) throws IOException
s - the source of the charactersstart - the first character in the sequencelength - the number of characters in the sequenceIOExceptionInputStream.readChars(char[],int,int)protected final void flush()
throws IOException
IOExceptionprotected abstract void flushBuffer(byte[] b,
int len)
throws IOException
b - the bytes to writelen - the number of bytes to writeIOExceptionpublic void close()
throws IOException
IOExceptionpublic final long getFilePointer()
throws IOException
IOExceptionseek(long)public void seek(long pos)
throws IOException
IOExceptiongetFilePointer()public abstract long length()
throws IOException
IOExceptionCopyright © 2024 GATE. All rights reserved.