public void close() throws IOException { decoder.inputStream().close(); } }
/** Close this reader. */ @Override public void close() throws IOException { vin.inputStream().close(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { mAvroDecoder.inputStream().close(); }
/** Close this reader. */ @Override public void close() throws IOException { vin.inputStream().close(); }
@Override protected void blockFinished() throws IOException { blockStart = sin.tell() - vin.inputStream().available(); }
@Override protected void blockFinished() throws IOException { blockStart = sin.tell() - vin.inputStream().available(); }
@Test public void testInputStreamProxyDetached() throws IOException { Decoder d = newDecoder(data); if (d instanceof BinaryDecoder) { BinaryDecoder bd = (BinaryDecoder) d; InputStream test = bd.inputStream(); InputStream check = new ByteArrayInputStream(data); // detach input stream and decoder from old source factory.binaryDecoder(new byte[56], null); InputStream bad = bd.inputStream(); InputStream check2 = new ByteArrayInputStream(data); validateInputStreamReads(test, check); Assert.assertFalse(bad.read() == check2.read()); } }
@Test public void testInputStreamProxy() throws IOException { Decoder d = newDecoder(data); if (d instanceof BinaryDecoder) { BinaryDecoder bd = (BinaryDecoder) d; InputStream test = bd.inputStream(); InputStream check = new ByteArrayInputStream(data); validateInputStreamReads(test, check); bd = factory.binaryDecoder(data, bd); test = bd.inputStream(); check = new ByteArrayInputStream(data); validateInputStreamSkips(test, check); // with input stream sources bd = factory.binaryDecoder(new ByteArrayInputStream(data), bd); test = bd.inputStream(); check = new ByteArrayInputStream(data); validateInputStreamReads(test, check); bd = factory.binaryDecoder(new ByteArrayInputStream(data), bd); test = bd.inputStream(); check = new ByteArrayInputStream(data); validateInputStreamSkips(test, check); } }
InputStream in = vin.inputStream(); vin.readFixed(syncBuffer); do {
InputStream in = vin.inputStream(); vin.readFixed(syncBuffer); do {
@Test public void testInputStreamPartiallyUsed() throws IOException { BinaryDecoder bd = factory.binaryDecoder( new ByteArrayInputStream(data), null); InputStream test = bd.inputStream(); InputStream check = new ByteArrayInputStream(data); // triggers buffer fill if unused and tests isEnd() try { Assert.assertFalse(bd.isEnd()); } catch (UnsupportedOperationException e) { // this is ok if its a DirectBinaryDecoder. if (bd.getClass() != DirectBinaryDecoder.class) { throw e; } } bd.readFloat(); // use data, and otherwise trigger buffer fill check.skip(4); // skip the same # of bytes here validateInputStreamReads(test, check); }
/** Close this reader. */ @Override public void close() throws IOException { vin.inputStream().close(); }
@Override public void close() throws IOException { decoder.inputStream().close(); }
/** Close this reader. */ @Override public void close() throws IOException { vin.inputStream().close(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { mAvroDecoder.inputStream().close(); }
/** Close this reader. */ public void close() throws IOException { vin.inputStream().close(); }
/** Close this reader. */ public void close() throws IOException { vin.inputStream().close(); }
public void close() throws IOException { decoder.inputStream().close(); } }
@Override protected void blockFinished() throws IOException { blockStart = sin.tell() - vin.inputStream().available(); }
@Override protected void blockFinished() throws IOException { blockStart = sin.tell() - vin.inputStream().available(); }