@Override public void close() throws IOException { super.close(); buffer.release(); } };
@Override public void close() throws IOException { super.close(); data.release(); } };
@Override public void close() throws IOException { super.close(); // let's make it actually repeatable content.readerIndex(0); } };
@Override public void close() throws IOException { if(CLOSE.compareAndSet(this, 0, 1)) { super.close(); bb.release(); } } }
@Override public void close() throws IOException { if(CLOSE.compareAndSet(this, 0, 1)) { super.close(); bb.release(); } } }
@Override public void close() throws IOException { if(CLOSE.compareAndSet(this, 0, 1)) { super.close(); bb.release(); } } }
@Override public void close() throws IOException { if(CLOSE.compareAndSet(this, 0, 1)) { super.close(); bb.release(); } } }
@Override protected void readFromStream(ByteBuf data) { ByteBufInputStream bbis = new ByteBufInputStream(data); try { packetData = CompressedStreamTools.readCompressed(bbis); } catch (IOException e) { e.printStackTrace(); } try { bbis.close(); } catch (IOException e) { e.printStackTrace(); } }
@Override public void clearBody() { if (bytesIn != null) { try { bytesIn.close(); } catch (IOException e) { } bytesIn = null; } if (bytesOut != null) { try { bytesOut.close(); } catch (IOException e) { } bytesOut = null; } setBody(EMPTY_BODY); }
@Override public void clearBody() { if (bytesIn != null) { try { bytesIn.close(); } catch (IOException e) { } bytesIn = null; } if (bytesOut != null) { try { bytesOut.close(); } catch (IOException e) { } bytesOut = null; } setBody(EMPTY_BODY); }
try { bis.read(temp); bis.close(); Inflater infl = new Inflater(true); infl.setInput(temp, 0, temp.length);
@Override public void reset() { if (bytesOut != null) { ByteBuf writeBuf = bytesOut.buffer(); Binary body = new Binary(writeBuf.array(), writeBuf.arrayOffset(), writeBuf.readableBytes()); setBody(new Data(body)); try { bytesOut.close(); } catch (IOException e) { } bytesOut = null; } else if (bytesIn != null) { try { bytesIn.close(); } catch (IOException e) { } bytesIn = null; } }
@Override public void reset() { if (bytesOut != null) { ByteBuf writeBuf = bytesOut.buffer(); Binary body = new Binary(writeBuf.array(), writeBuf.arrayOffset(), writeBuf.readableBytes()); setBody(new Data(body)); try { bytesOut.close(); } catch (IOException e) { } bytesOut = null; } else if (bytesIn != null) { try { bytesIn.close(); } catch (IOException e) { } bytesIn = null; } }