@Override public void write(int b) throws IOException { if (checkWithinLimits(1)) { super.write(b); count++; } }
private static HttpEntity loadEntity(HttpEntity entity, Long limit) throws IOException { if (entity.isRepeatable()) { return entity; } else { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); if (limit != null) { entity.writeTo(new BoundedOutputStream(buffer, limit, true)); } else { entity.writeTo(buffer); } buffer.close(); return new ByteArrayEntity(buffer.toByteArray()); } } }
@Override public void write(byte[] b) throws IOException { if (checkWithinLimits(b.length)) { super.write(b); count += b.length; } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (checkWithinLimits(len)) { super.write(b, off, len); count += len; } }
@Override public void write(int b) throws IOException { if (checkWithinLimits(1)) { super.write(b); count++; } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (checkWithinLimits(len)) { super.write(b, off, len); count += len; } }
@Override public void write(byte[] b) throws IOException { if (checkWithinLimits(b.length)) { super.write(b); count += b.length; } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (checkWithinLimits(len)) { super.write(b, off, len); count += len; } }
@Override public void write(byte[] b) throws IOException { if (checkWithinLimits(b.length)) { super.write(b); count += b.length; } }
@Override public void write(int b) throws IOException { if (checkWithinLimits(1)) { super.write(b); count++; } }