@Override public void write(int b) throws IOException { if (hasReachedLimit()) throw new ByteLimitExceededException(byteLimit); ostream.write(b); byteCount++; }
@Override public void write(byte[] b) throws IOException { if (hasReachedLimit()) throw new ByteLimitExceededException(byteLimit); ostream.write(b); byteCount += b.length; }
@Override public void write(byte[] b, int offset, int num) throws IOException { if (hasReachedLimit()) throw new ByteLimitExceededException(byteLimit); ostream.write(b, offset, num); byteCount += num; }