Top Fields Constructors Methods
org.mortbay.io.bio

public Class StreamEndPoint

extends Object
implements EndPoint
Class Inheritance
All Implemented Interfaces
org.mortbay.io.EndPoint
Known Direct Subclasses
org.mortbay.io.bio.StringEndPoint, org.mortbay.io.bio.SocketEndPoint
Imports
java.io.IOException, .InputStream, .OutputStream, org.mortbay.io.Buffer, .EndPoint

Author
gregw To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Field Summary

Modifier and TypeField and Description
pack-priv InputStream
pack-priv OutputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public void
close()

Implements org.mortbay.io.EndPoint.close.

Close any backing stream associated with the buffer
public int
fill(Buffer buffer)

Implements org.mortbay.io.EndPoint.fill.

Fill the buffer from the current putIndex to it's capacity from whatever byte source is backing the buffer.
public int
flush(Buffer
The buffer to flush. This buffers getIndex is updated.
buffer
)

Implements org.mortbay.io.EndPoint.flush.

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.
public int
flush(Buffer
A buffer to write before flushing this buffer. This buffers getIndex is updated.
header
,
Buffer
The buffer to flush. This buffers getIndex is updated.
buffer
,
Buffer
A buffer to write after flushing this buffer. This buffers getIndex is updated.
trailer
)

Implements org.mortbay.io.EndPoint.flush.

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.
public void
flush()

Implements org.mortbay.io.EndPoint.flush.

Flush any buffered output.
public InputStream
public String
public String
public int
public OutputStream
public String
public String
public int
public Object
public boolean
public boolean
public boolean
public boolean
public final boolean
public boolean
public void
public void
public void
shutdownOutput()

Implements org.mortbay.io.EndPoint.shutdownOutput.

Shutdown any backing output stream associated with the endpoint
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_inback to summary
pack-priv InputStream _in
_outback to summary
pack-priv OutputStream _out

Constructor Detail

StreamEndPointback to summary
public StreamEndPoint(InputStream in, OutputStream out)

Method Detail

blockReadableback to summary
public boolean blockReadable(long millisecs) throws IOException

Implements org.mortbay.io.EndPoint.blockReadable.

blockWritableback to summary
public boolean blockWritable(long millisecs) throws IOException

Implements org.mortbay.io.EndPoint.blockWritable.

closeback to summary
public void close() throws IOException

Implements org.mortbay.io.EndPoint.close.

Doc from org.mortbay.io.EndPoint.close.

Close any backing stream associated with the buffer

fillback to summary
public int fill(Buffer buffer) throws IOException

Implements org.mortbay.io.EndPoint.fill.

Doc from org.mortbay.io.EndPoint.fill.

Fill the buffer from the current putIndex to it's capacity from whatever byte source is backing the buffer. The putIndex is increased if bytes filled. The buffer may chose to do a compact before filling.

Returns:int

an int value indicating the number of bytes filled or -1 if EOF is reached.

flushback to summary
public int flush(Buffer buffer) throws IOException

Implements org.mortbay.io.EndPoint.flush.

Doc from org.mortbay.io.EndPoint.flush.

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer. The getIndex is updated with the number of bytes flushed. Any mark set is cleared. If the entire contents of the buffer are flushed, then an implicit empty() is done.

Parameters
buffer:Buffer

The buffer to flush. This buffers getIndex is updated.

Returns:int

the number of bytes written

flushback to summary
public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException

Implements org.mortbay.io.EndPoint.flush.

Doc from org.mortbay.io.EndPoint.flush.

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer. The getIndex is updated with the number of bytes flushed. Any mark set is cleared. If the entire contents of the buffer are flushed, then an implicit empty() is done. The passed header/trailer buffers are written before/after the contents of this buffer. This may be done either as gather writes, as a poke into this buffer or as several writes. The implementation is free to select the optimal mechanism.

Parameters
header:Buffer

A buffer to write before flushing this buffer. This buffers getIndex is updated.

buffer:Buffer

The buffer to flush. This buffers getIndex is updated.

trailer:Buffer

A buffer to write after flushing this buffer. This buffers getIndex is updated.

Returns:int

the total number of bytes written.

flushback to summary
public void flush() throws IOException

Implements org.mortbay.io.EndPoint.flush.

Doc from org.mortbay.io.EndPoint.flush.

Flush any buffered output. May fail to write all data if endpoint is non-blocking

getInputStreamback to summary
public InputStream getInputStream()
getLocalAddrback to summary
public String getLocalAddr()

Implements org.mortbay.io.EndPoint.getLocalAddr.

Returns:String

Doc from org.mortbay.io.EndPoint.getLocalAddr.

The local IP address to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.

getLocalHostback to summary
public String getLocalHost()

Implements org.mortbay.io.EndPoint.getLocalHost.

Returns:String

Doc from org.mortbay.io.EndPoint.getLocalHost.

The local host name to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.

getLocalPortback to summary
public int getLocalPort()

Implements org.mortbay.io.EndPoint.getLocalPort.

Returns:int

Doc from org.mortbay.io.EndPoint.getLocalPort.

The local port number on which this EndPoint is listening, or 0 if this EndPoint does not represent a network connection.

getOutputStreamback to summary
public OutputStream getOutputStream()
getRemoteAddrback to summary
public String getRemoteAddr()

Implements org.mortbay.io.EndPoint.getRemoteAddr.

Returns:String

Doc from org.mortbay.io.EndPoint.getRemoteAddr.

The remote IP address to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.

getRemoteHostback to summary
public String getRemoteHost()

Implements org.mortbay.io.EndPoint.getRemoteHost.

Returns:String

Doc from org.mortbay.io.EndPoint.getRemoteHost.

The host name of the remote machine to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.

getRemotePortback to summary
public int getRemotePort()

Implements org.mortbay.io.EndPoint.getRemotePort.

Returns:int

Doc from org.mortbay.io.EndPoint.getRemotePort.

The remote port number to which this EndPoint is connected, or 0 if this EndPoint does not represent a network connection.

getTransportback to summary
public Object getTransport()

Implements org.mortbay.io.EndPoint.getTransport.

Returns:Object

Doc from org.mortbay.io.EndPoint.getTransport.

The underlying transport object (socket, channel, etc.)

isBlockingback to summary
public boolean isBlocking()

Implements org.mortbay.io.EndPoint.isBlocking.

isBufferingInputback to summary
public boolean isBufferingInput()

Implements org.mortbay.io.EndPoint.isBufferingInput.

Returns:boolean

Doc from org.mortbay.io.EndPoint.isBufferingInput.

True if the endpoint has some buffered input data

isBufferingOutputback to summary
public boolean isBufferingOutput()

Implements org.mortbay.io.EndPoint.isBufferingOutput.

Returns:boolean

Doc from org.mortbay.io.EndPoint.isBufferingOutput.

True if the endpoint has some buffered output data

isBufferredback to summary
public boolean isBufferred()

Implements org.mortbay.io.EndPoint.isBufferred.

isClosedback to summary
public final boolean isClosed()
isOpenback to summary
public boolean isOpen()

Implements org.mortbay.io.EndPoint.isOpen.

setInputStreamback to summary
public void setInputStream(InputStream in)
setOutputStreamback to summary
public void setOutputStream(OutputStream out)
shutdownOutputback to summary
public void shutdownOutput() throws IOException

Implements org.mortbay.io.EndPoint.shutdownOutput.

Doc from org.mortbay.io.EndPoint.shutdownOutput.

Shutdown any backing output stream associated with the endpoint