@Override public void write(int b) throws IOException { if (closed) { throw new IOException("Stream is closed"); } if (position >= blockSize) { flushBuffer(); } buffer[position++] = (byte) b; }
@Override public void write(int b) throws IOException { if (closed) { throw new IOException("Stream is closed"); } if (position >= blockSize) { flushBuffer(); } buffer[position++] = (byte) b; }
@Override public void flush() throws IOException { if (closed) { throw new IOException("Stream is closed"); } flushBuffer(); out.flush(); }
@Override public void flush() throws IOException { if (closed) { throw new IOException("Stream is closed"); } flushBuffer(); out.flush(); }
flushBuffer(); offset += free; length -= free;
flushBuffer(); offset += free; length -= free;