List of usage examples for com.google.common.io CountingOutputStream write
@Override public void write(int b) throws IOException
From source file:com.tinspx.util.net.MultipartBody.java
private long doCopyTo(OutputStream output) throws IOException { assert checkNotEmpty(); CountingOutputStream counter = new CountingOutputStream(output); counter.write(preamble); for (PartCache pc : partCache) { counter.write(pc.bytes);//from w w w .j a v a2 s . co m pc.part.copyTo(counter); } counter.write(CRLF); counter.write(DASHDASH); counter.write(boundaryBytes); counter.write(DASHDASH); counter.write(CRLF); counter.write(epilogue); return counter.getCount(); }