public class ByteArrayEndPoint extends AbstractEndPoint
| 构造器和说明 |
|---|
ByteArrayEndPoint() |
ByteArrayEndPoint(byte[] input,
int outputSize) |
ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler scheduler,
long idleTimeoutMs) |
ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
byte[] input,
int outputSize) |
ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
ByteBuffer input,
ByteBuffer output) |
ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
String input,
int outputSize) |
ByteArrayEndPoint(String input,
int outputSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addInput(ByteBuffer in) |
void |
addInput(String s) |
void |
addInput(String s,
Charset charset) |
void |
addInputAndExecute(ByteBuffer in) |
void |
addInputEOF() |
void |
doClose() |
void |
doShutdownOutput() |
protected void |
execute(Runnable task) |
int |
fill(ByteBuffer buffer)
Fill the passed buffer with data from this endpoint.
|
boolean |
flush(ByteBuffer... buffers)
Flush data from the passed header/buffer to this endpoint.
|
InetSocketAddress |
getLocalAddress() |
ByteBuffer |
getOutput() |
String |
getOutputString() |
String |
getOutputString(Charset charset) |
InetSocketAddress |
getRemoteAddress() |
Object |
getTransport() |
boolean |
hasMore() |
boolean |
isGrowOutput() |
protected void |
needsFillInterest() |
protected void |
onIncompleteFlush() |
void |
reset() |
void |
setGrowOutput(boolean growOutput) |
void |
setOutput(ByteBuffer out) |
ByteBuffer |
takeOutput() |
String |
takeOutputString() |
String |
takeOutputString(Charset charset) |
String |
toString() |
ByteBuffer |
waitForOutput(long time,
TimeUnit unit)
Wait for some output
|
checkFill, checkFlush, close, close, doShutdownInput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getWriteFlusher, isFillInterested, isInputShutdown, isOpen, isOptimizedForDirectBuffers, isOutputShutdown, onClose, onClose, onIdleExpired, onOpen, setConnection, shutdownInput, shutdownOutput, toConnectionString, toEndPointString, tryFillInterested, upgrade, writecheckIdleTimeout, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, notIdle, setIdleTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdleTimeout, setIdleTimeoutpublic ByteArrayEndPoint()
public ByteArrayEndPoint(byte[] input,
int outputSize)
input - the input bytesoutputSize - the output sizepublic ByteArrayEndPoint(String input, int outputSize)
input - the input string (converted to bytes using default encoding charset)outputSize - the output sizepublic ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler scheduler,
long idleTimeoutMs)
public ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
byte[] input,
int outputSize)
public ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
String input,
int outputSize)
public ByteArrayEndPoint(org.eclipse.jetty.util.thread.Scheduler timer,
long idleTimeoutMs,
ByteBuffer input,
ByteBuffer output)
public void doShutdownOutput()
doShutdownOutput 在类中 AbstractEndPointpublic void doClose()
doClose 在类中 AbstractEndPointpublic InetSocketAddress getLocalAddress()
EndPoint is bound, or null
if this EndPoint does not represent a network connection.public InetSocketAddress getRemoteAddress()
EndPoint is bound, or null
if this EndPoint does not represent a network connection.protected void onIncompleteFlush()
onIncompleteFlush 在类中 AbstractEndPointprotected void execute(Runnable task)
protected void needsFillInterest()
throws IOException
needsFillInterest 在类中 AbstractEndPointIOExceptionpublic void addInputEOF()
public void addInput(ByteBuffer in)
in - The in to set.public void addInputAndExecute(ByteBuffer in)
public void addInput(String s)
public ByteBuffer getOutput()
public String getOutputString()
public String getOutputString(Charset charset)
charset - the charset to encode the output aspublic ByteBuffer takeOutput()
public ByteBuffer waitForOutput(long time, TimeUnit unit) throws InterruptedException
time - Time to waitunit - Units for time to waitInterruptedException - if interruptedpublic String takeOutputString()
public String takeOutputString(Charset charset)
charset - the charset to encode the output aspublic void setOutput(ByteBuffer out)
out - The out to set.public boolean hasMore()
true if there are bytes remaining to be read from the encoded inputpublic int fill(ByteBuffer buffer) throws IOException
EndPointbuffer - The buffer to fill. The position and limit are modified during the fill. After the
operation, the position is unchanged and the limit is increased to reflect the new data filled.int value indicating the number of bytes
filled or -1 if EOF is read or the input is shutdown.IOException - if the endpoint is closed.public boolean flush(ByteBuffer... buffers) throws IOException
EndPointbuffers - the buffers to flushIOException - If the endpoint is closed or output is shutdown.public void reset()
reset 在类中 AbstractEndPointpublic Object getTransport()
public boolean isGrowOutput()
public void setGrowOutput(boolean growOutput)
growOutput - the growOutput to setpublic String toString()
toString 在类中 AbstractEndPointCopyright © 2017. All rights reserved.