private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
private void assertReady() throws IOException { // if the last frame (fin flag == 1) has been queued already - throw an IOException if (isTerminated()) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Terminated!!! id={0} description={1}", new Object[]{stream.getId(), terminationFlag.getDescription()}); } throw new IOException(terminationFlag.getDescription()); } else if (isLastFrameQueued) { throw new IOException("Write beyond end of stream"); } }
@Override public Buffer read(final int length) throws Http2StreamException { if (isClosed) { throw new Http2StreamException(stream.getId(), ErrorCode.INTERNAL_ERROR, "The source was closed"); } final int remaining = buffer.remaining(); if (length == 0 || remaining == 0) { return Buffers.EMPTY_BUFFER; } final int bytesToSplit = Math.min(remaining, length); final Buffer newBuf = buffer.split(buffer.position() + bytesToSplit); final Buffer bufferToReturn = buffer; buffer = newBuf; return bufferToReturn; }
@Override public Buffer read(final int length) throws Http2StreamException { if (isClosed) { throw new Http2StreamException(stream.getId(), ErrorCode.INTERNAL_ERROR, "The source was closed"); } final int remaining = buffer.remaining(); if (length == 0 || remaining == 0) { return Buffers.EMPTY_BUFFER; } final int bytesToSplit = Math.min(remaining, length); final Buffer newBuf = buffer.split(buffer.position() + bytesToSplit); final Buffer bufferToReturn = buffer; buffer = newBuf; return bufferToReturn; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }