public void write(int b) throws IOException { buffer[bytesWritten++] = (byte) b; if (bytesWritten == segmentLength) { flush(); } } }
public void write(byte[] b) throws IOException { this.write(b, 0, b.length); }
private void writeIDAT() throws IOException IDATOutputStream ios = new IDATOutputStream(dataOutput, 8192); DeflaterOutputStream dos = new DeflaterOutputStream(ios, new Deflater(9)); ios.flush();
public void flush() throws IOException { // Length writeInt(bytesWritten); // 'IDAT' signature out.write(typeSignature); // Data out.write(buffer, 0, bytesWritten); int crc = 0xffffffff; crc = CRC.updateCRC(crc, typeSignature, 0, 4); crc = CRC.updateCRC(crc, buffer, 0, bytesWritten); // CRC writeInt(crc ^ 0xffffffff); // Reset buffer bytesWritten = 0; }
private void writeIDAT() throws IOException IDATOutputStream ios = new IDATOutputStream(dataOutput, 8192); DeflaterOutputStream dos = new DeflaterOutputStream(ios, new Deflater(9)); ios.flush();
public void flush() throws IOException { // Length writeInt(bytesWritten); // 'IDAT' signature out.write(typeSignature); // Data out.write(buffer, 0, bytesWritten); int crc = 0xffffffff; crc = CRC.updateCRC(crc, typeSignature, 0, 4); crc = CRC.updateCRC(crc, buffer, 0, bytesWritten); // CRC writeInt(crc ^ 0xffffffff); // Reset buffer bytesWritten = 0; }
public void write(int b) throws IOException { buffer[bytesWritten++] = (byte) b; if (bytesWritten == segmentLength) { flush(); } } }
public void write(byte[] b) throws IOException { this.write(b, 0, b.length); }
public void close() throws IOException { flush(); }
public void close() throws IOException { flush(); }
public void write(byte[] b, int off, int len) throws IOException { while (len > 0) { int bytes = Math.min(segmentLength - bytesWritten, len); System.arraycopy(b, off, buffer, bytesWritten, bytes); off += bytes; len -= bytes; bytesWritten += bytes; if (bytesWritten == segmentLength) { flush(); } } }
public void write(byte[] b, int off, int len) throws IOException { while (len > 0) { int bytes = Math.min(segmentLength - bytesWritten, len); System.arraycopy(b, off, buffer, bytesWritten, bytes); off += bytes; len -= bytes; bytesWritten += bytes; if (bytesWritten == segmentLength) { flush(); } } }