/** * {@inheritDoc} */ @Override public Buffer getBufferWindow() { return input.getBuffer(); }
/** * {@inheritDoc} */ @Override public boolean isSupportBufferWindow() { return input.isBuffered(); }
/** * {@inheritDoc} */ @Override public byte readByte() throws IOException { return input.read(); }
if (underlyingInput.isBuffered()) { chunkBuffer = underlyingInput.takeBuffer(); } else { int size = underlyingInput.size(); chunkBuffer = memoryManager.allocate(size); while (size-- >= 0) { chunkBuffer.put(underlyingInput.read());
/** * {@inheritDoc} */ @Override public void readByteArray(byte[] data, int offset, int length) throws IOException { arraySizeCheck(length); if (input.isBuffered()) { final Buffer buffer = input.getBuffer(); buffer.get(data, offset, length); buffer.shrink(); } else { for(int i = offset; i < length; i++) { data[i] = input.read(); } } }
@Override protected void onOpenInputSource() throws IOException { underlyingInput.notifyCondition(new TransformerCondition(), new TransformerCompletionHandler()); }
/** * {@inheritDoc} */ @Override public Buffer takeBufferWindow() { return input.takeBuffer(); }
/** * {@inheritDoc} */ @Override public int available() { return input.size(); }
@Override public void skip(int length) { input.skip(length); }
/** * Closes the <tt>StreamReader</tt> and causes all subsequent method calls * on this object to throw IllegalStateException. */ @Override public void close() { if (isClosed.compareAndSet(false, true)) { if (input != null) { try { input.close(); } catch (IOException ignored) { } } } }
/** * {@inheritDoc} */ @Override public int readInt() throws IOException { if (input.isBuffered()) { final Buffer buffer = input.getBuffer(); if (buffer != null && buffer.remaining() >= 4) { final int result = buffer.getInt(); buffer.shrink(); return result; } } return (readShort() & 0xffff) << 16 | readShort() & 0xffff; }
@Override protected void onOpenInputSource() throws IOException { underlyingInput.notifyCondition(new TransformerCondition(), new TransformerCompletionHandler()); }
/** * {@inheritDoc} */ @Override public Buffer takeBufferWindow() { return input.takeBuffer(); }
/** * {@inheritDoc} */ @Override public int available() { return input.size(); }
@Override public void skip(int length) { input.skip(length); }
/** * Closes the <tt>StreamReader</tt> and causes all subsequent method calls * on this object to throw IllegalStateException. */ @Override public void close() { if (isClosed.compareAndSet(false, true)) { if (input != null) { try { input.close(); } catch (IOException ignored) { } } } }
@Override protected void onOpenInputSource() throws IOException { underlyingInput.notifyCondition(new TransformerCondition(), new TransformerCompletionHandler()); }
/** * {@inheritDoc} */ @Override public Buffer takeBufferWindow() { return input.takeBuffer(); }
/** * {@inheritDoc} */ @Override public byte readByte() throws IOException { return input.read(); }
/** * {@inheritDoc} */ @Override public int available() { return input.size(); }