Top Description Inners Constructors Methods
org.glassfish.grizzly.http2

pack-priv abstract Class Source

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.http2.Source.SourceFactory.BufferSource
Imports
java.io.File, org.glassfish.grizzly.Buffer, org.glassfish.grizzly.http2.frames.ErrorCode, org.glassfish.grizzly.memory.Buffers

The class represents generic source of data to be sent on Http2Stream.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Source.SourceFactory

The helper factory class to create Sources based on File, Buffer, String and byte[].

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static Source.SourceFactory
factory(final Http2Stream http2Stream)

Returns the SourceFactory associated with the Http2Stream.

public abstract boolean
hasRemaining()

Returns true if there is more data to be written, or false otherwise.

public abstract Buffer

Returns:

Buffer, which contains up to length bytes (could return less) to be written. null result is not permitted.
read
(final int
max number of bytes to return.
length
)

Returns the number of bytes to be written.

public abstract void
release()

The method is called, when the source might be released/closed.

public abstract int
remaining()

Returns the number of bytes remaining to be written.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Sourceback to summary
pack-priv Source()

Method Detail

factoryback to summary
public static Source.SourceFactory factory(final Http2Stream http2Stream)

Returns the SourceFactory associated with the Http2Stream.

hasRemainingback to summary
public abstract boolean hasRemaining()

Returns true if there is more data to be written, or false otherwise.

readback to summary
public abstract Buffer read(final int length) throws Http2StreamException

Returns the number of bytes to be written.

Parameters
length:int

max number of bytes to return.

Returns:Buffer

Buffer, which contains up to length bytes (could return less) to be written. null result is not permitted.

Exceptions
Http2StreamException:
if an error occurs reading from the stream.
releaseback to summary
public abstract void release()

The method is called, when the source might be released/closed.

remainingback to summary
public abstract int remaining()

Returns the number of bytes remaining to be written.

org.glassfish.grizzly.http2 back to summary

public final Class Source.SourceFactory

extends Object
Class Inheritance

The helper factory class to create Sources based on File, Buffer, String and byte[].

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Http2Stream

Constructor Summary

AccessConstructor and Description
private
SourceFactory(final Http2Stream stream)

Method Summary

Modifier and TypeMethod and Description
public Source

Returns:

Source.
createBufferSource
(final Buffer
Buffer to be written.
buffer
)

Create Source based on Buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

streamback to summary
private final Http2Stream stream

Constructor Detail

SourceFactoryback to summary
private SourceFactory(final Http2Stream stream)

Method Detail

createBufferSourceback to summary
public Source createBufferSource(final Buffer buffer)

Create Source based on Buffer.

Parameters
buffer:Buffer

Buffer to be written.

Returns:Source

Source.

org.glassfish.grizzly.http2 back to summary

private Class Source.SourceFactory.BufferSource

extends Source
Class Inheritance

Source implementation based on Buffer.

Field Summary

Modifier and TypeField and Description
private Buffer
private boolean
private final Http2Stream

Constructor Summary

AccessConstructor and Description
protected
BufferSource(final Buffer buffer, final Http2Stream stream)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasRemaining()

Implements abstract org.glassfish.grizzly.http2.Source.hasRemaining.

Returns true if there is more data to be written, or false otherwise.

public Buffer
read(final int length)

Implements abstract org.glassfish.grizzly.http2.Source.read.

Returns the number of bytes to be written.

public void
release()

Implements abstract org.glassfish.grizzly.http2.Source.release.

The method is called, when the source might be released/closed.

public int
remaining()

Implements abstract org.glassfish.grizzly.http2.Source.remaining.

Returns the number of bytes remaining to be written.

Inherited from org.glassfish.grizzly.http2.Source:
factory

Field Detail

bufferback to summary
private Buffer buffer
isClosedback to summary
private boolean isClosed
streamback to summary
private final Http2Stream stream

Constructor Detail

BufferSourceback to summary
protected BufferSource(final Buffer buffer, final Http2Stream stream)

Method Detail

hasRemainingback to summary
public boolean hasRemaining()

Implements abstract org.glassfish.grizzly.http2.Source.hasRemaining.

Doc from org.glassfish.grizzly.http2.Source.hasRemaining.

Returns true if there is more data to be written, or false otherwise.

Annotations
@Override
readback to summary
public Buffer read(final int length) throws Http2StreamException

Implements abstract org.glassfish.grizzly.http2.Source.read.

Doc from org.glassfish.grizzly.http2.Source.read.

Returns the number of bytes to be written.

Annotations
@Override
Exceptions
Http2StreamException:
if an error occurs reading from the stream.
releaseback to summary
public void release()

Implements abstract org.glassfish.grizzly.http2.Source.release.

Doc from org.glassfish.grizzly.http2.Source.release.

The method is called, when the source might be released/closed.

Annotations
@Override
remainingback to summary
public int remaining()

Implements abstract org.glassfish.grizzly.http2.Source.remaining.

Doc from org.glassfish.grizzly.http2.Source.remaining.

Returns the number of bytes remaining to be written.

Annotations
@Override