Top Description Fields Constructors Methods
org.mortbay.io

public Class ByteArrayEndPoint

extends Object
implements EndPoint
Class Inheritance
All Implemented Interfaces
org.mortbay.io.EndPoint
Imports
java.io.IOException

ByteArrayEndPoint.
Author
gregw

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv boolean
pack-priv ByteArrayBuffer
pack-priv byte[]
pack-priv boolean
pack-priv ByteArrayBuffer

Constructor Summary

AccessConstructor and Description
public
public
ByteArrayEndPoint(byte[] input, int outputSize)

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 ByteArrayBuffer

Returns:

Returns the in.
getIn
()

public String
public String
public int
public ByteArrayBuffer

Returns:

Returns the out.
getOut
()

public String
public String
public int
public Object
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

the growOutput
isGrowOutput
()

public boolean

Returns:

the nonBlocking
isNonBlocking
()

public boolean
public void
public void
setGrowOutput(boolean
the growOutput to set
growOutput
)

public void
setIn(ByteArrayBuffer
The in to set.
in
)

public void
setNonBlocking(boolean
the nonBlocking to set
nonBlocking
)

public void
setOut(ByteArrayBuffer
The out to set.
out
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_closedback to summary
pack-priv boolean _closed
_growOutputback to summary
pack-priv boolean _growOutput
_inback to summary
pack-priv ByteArrayBuffer _in
_inBytesback to summary
pack-priv byte[] _inBytes
_nonBlockingback to summary
pack-priv boolean _nonBlocking
_outback to summary
pack-priv ByteArrayBuffer _out

Constructor Detail

ByteArrayEndPointback to summary
public ByteArrayEndPoint()
ByteArrayEndPointback to summary
public ByteArrayEndPoint(byte[] input, int outputSize)

Method Detail

blockReadableback to summary
public boolean blockReadable(long millisecs)

Implements org.mortbay.io.EndPoint.blockReadable.

blockWritableback to summary
public boolean blockWritable(long millisecs)

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

getInback to summary
public ByteArrayBuffer getIn()
Returns:ByteArrayBuffer

Returns the in.

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.

getOutback to summary
public ByteArrayBuffer getOut()
Returns:ByteArrayBuffer

Returns the out.

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.

isGrowOutputback to summary
public boolean isGrowOutput()
Returns:boolean

the growOutput

isNonBlockingback to summary
public boolean isNonBlocking()
Returns:boolean

the nonBlocking

isOpenback to summary
public boolean isOpen()

Implements org.mortbay.io.EndPoint.isOpen.

resetback to summary
public void reset()
setGrowOutputback to summary
public void setGrowOutput(boolean growOutput)
Parameters
growOutput:boolean

the growOutput to set

setInback to summary
public void setIn(ByteArrayBuffer in)
Parameters
in:ByteArrayBuffer

The in to set.

setNonBlockingback to summary
public void setNonBlocking(boolean nonBlocking)
Parameters
nonBlocking:boolean

the nonBlocking to set

setOutback to summary
public void setOut(ByteArrayBuffer out)
Parameters
out:ByteArrayBuffer

The out to set.