@Contract(threading=SAFE) public final class SharedOutputBuffer extends ExpandableBuffer implements ContentOutputBuffer
ExpandableBuffer.Mode| 构造器和说明 |
|---|
SharedOutputBuffer(int bufferSize) |
SharedOutputBuffer(ReentrantLock lock,
int initialBufferSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort() |
int |
capacity()
Returns available capacity of this buffer.
|
void |
flush(DataStreamChannel channel) |
boolean |
hasData()
Determines if the buffer contains data.
|
boolean |
isEndStream() |
int |
length()
Returns the length of this buffer.
|
void |
reset() |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to this buffer. |
void |
write(int b)
Writes the specified byte to this buffer.
|
void |
writeCompleted()
Indicates the content has been fully written.
|
buffer, clear, ensureAdjustedCapacity, ensureCapacity, expand, mode, setInputMode, setOutputMode, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlength, resetpublic SharedOutputBuffer(ReentrantLock lock, int initialBufferSize)
public SharedOutputBuffer(int bufferSize)
public void flush(DataStreamChannel channel) throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
ContentOutputBufferlen bytes from the specified byte array
starting at offset off to this buffer.
If off is negative, or len is negative, or
off+len is greater than the length of the array
b, this method can throw a runtime exception. The exact type
of runtime exception thrown by this method depends on implementation.
write 在接口中 ContentOutputBufferb - the data.off - the start offset in the data.len - the number of bytes to write.IOException - if an I/O error occurs.public void write(int b)
throws IOException
ContentOutputBufferwrite 在接口中 ContentOutputBufferb - the byte.IOException - if an I/O error occurs.public void writeCompleted()
throws IOException
ContentOutputBufferwriteCompleted 在接口中 ContentOutputBufferIOException - if an I/O error occurs.public boolean hasData()
ExpandableBufferSets the mode to output.
hasData 在类中 ExpandableBuffertrue if there is data in the buffer,
false otherwise.public int capacity()
ExpandableBuffercapacity 在类中 ExpandableBufferpublic int length()
ExpandableBufferSets the mode to output.
length 在类中 ExpandableBufferpublic void abort()
public void reset()
public boolean isEndStream()
Copyright © 2023. All rights reserved.