本文整理汇总了Java中org.apache.qpid.proton.engine.Transport.END_OF_STREAM属性的典型用法代码示例。如果您正苦于以下问题:Java Transport.END_OF_STREAM属性的具体用法?Java Transport.END_OF_STREAM怎么用?Java Transport.END_OF_STREAM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.qpid.proton.engine.Transport
的用法示例。
在下文中一共展示了Transport.END_OF_STREAM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pourAll
/**
* Pours the contents of {@code source} into {@code destinationTransportInput}, calling
* the TransportInput many times if necessary. If the TransportInput returns a {@link org.apache.qpid.proton.engine.TransportResult}
* other than ok, data may remain in source.
*/
public static int pourAll(ByteBuffer source, TransportInput destinationTransportInput) throws TransportException
{
int capacity = destinationTransportInput.capacity();
if (capacity == Transport.END_OF_STREAM)
{
if (source.hasRemaining()) {
throw new IllegalStateException("Destination has reached end of stream: " +
destinationTransportInput);
} else {
return Transport.END_OF_STREAM;
}
}
int total = source.remaining();
while(source.hasRemaining() && destinationTransportInput.capacity() > 0)
{
pour(source, destinationTransportInput.tail());
destinationTransportInput.process();
}
return total - source.remaining();
}
示例2: recv
int recv(final byte[] bytes, int offset, int size)
{
final int consumed;
if (_data != null)
{
//TODO - should only be if no bytes left
consumed = Math.min(size, _dataSize);
System.arraycopy(_data, _offset, bytes, offset, consumed);
_offset += consumed;
_dataSize -= consumed;
}
else
{
_dataSize = consumed = 0;
}
return (_complete && consumed == 0) ? Transport.END_OF_STREAM : consumed; //TODO - Implement
}
示例3: pending
@Override
public int pending()
{
if (isOutputInSaslMode() || _outputBuffer.position() != 0)
{
fillOutputBuffer();
_head.limit(_outputBuffer.position());
if (_head_closed && _outputBuffer.position() == 0)
{
return Transport.END_OF_STREAM;
}
else
{
return _outputBuffer.position();
}
}
else
{
return _underlyingOutput.pending();
}
}
示例4: pending
@Override
public int pending()
{
try {
wrapOutput();
} catch (SSLException e) {
_logger.log(Level.WARNING, e.getMessage());
_head_closed = true;
}
_head.limit(_outputBuffer.position());
if (_head_closed && _outputBuffer.position() == 0) {
return Transport.END_OF_STREAM;
}
return _outputBuffer.position();
}
示例5: capacity
@Override
public int capacity()
{
if (_tail_closed) {
return Transport.END_OF_STREAM;
} else {
if (_inputBuffer != null) {
return _inputBuffer.remaining();
} else {
return _inputBufferSize;
}
}
}
示例6: position
@Override
public int position() {
if (_tail_closed) {
return Transport.END_OF_STREAM;
}
return (_inputBuffer == null) ? 0 : _inputBuffer.position();
}
示例7: capacity
@Override
public int capacity()
{
if (_tail_closed) return Transport.END_OF_STREAM;
if (isInputInSaslMode())
{
return _inputBuffer.remaining();
}
else
{
return _underlyingInput.capacity();
}
}
示例8: position
@Override
public int position()
{
if (_tail_closed) return Transport.END_OF_STREAM;
if (isInputInSaslMode())
{
return _inputBuffer.position();
}
else
{
return _underlyingInput.position();
}
}
示例9: reallyProcessInput
private void reallyProcessInput() throws TransportException
{
if(isInputInSaslMode())
{
if(_logger.isLoggable(Level.FINER))
{
_logger.log(Level.FINER, SaslImpl.this + " about to call input.");
}
_frameParser.input(_inputBuffer);
}
if(!isInputInSaslMode())
{
if(_logger.isLoggable(Level.FINER))
{
_logger.log(Level.FINER, SaslImpl.this + " about to call plain input");
}
if (_inputBuffer.hasRemaining())
{
int bytes = pourAll(_inputBuffer, _underlyingInput);
if (bytes == Transport.END_OF_STREAM)
{
_tail_closed = true;
}
_underlyingInput.process();
}
else
{
_underlyingInput.process();
}
}
}
示例10: capacity
@Override
public int capacity()
{
initTransportWrapperOnFirstIO();
if (_initException == null) {
return _transportWrapper.capacity();
} else {
return Transport.END_OF_STREAM;
}
}
示例11: position
@Override
public int position()
{
initTransportWrapperOnFirstIO();
if (_initException == null) {
return _transportWrapper.position();
} else {
return Transport.END_OF_STREAM;
}
}
示例12: capacity
@Override
public int capacity()
{
if (isDeterminationMade())
{
return _selectedTransportWrapper.capacity();
}
else
{
if (_tail_closed) { return Transport.END_OF_STREAM; }
return _determinationBuffer.remaining();
}
}
示例13: position
@Override
public int position()
{
if (isDeterminationMade())
{
return _selectedTransportWrapper.position();
}
else
{
if (_tail_closed) { return Transport.END_OF_STREAM; }
return _determinationBuffer.position();
}
}
示例14: pending
@Override
public int pending()
{
if (_head_closed) { return Transport.END_OF_STREAM; }
if (isDeterminationMade()) {
return _selectedTransportWrapper.pending();
} else {
return 0;
}
}
示例15: pending
@Override
public int pending()
{
if (_head_closed) {
return Transport.END_OF_STREAM;
}
if(_outputBuffer == null)
{
init_buffers();
}
_output_done = _transportOutputWriter.writeInto(_outputBuffer);
_head.limit(_outputBuffer.position());
if (_outputBuffer.position() == 0 && _outputBuffer.capacity() > TransportImpl.BUFFER_RELEASE_THRESHOLD)
{
release_buffers();
}
if (_output_done && (_outputBuffer == null || _outputBuffer.position() == 0))
{
return Transport.END_OF_STREAM;
}
else
{
return _outputBuffer == null ? 0 : _outputBuffer.position();
}
}