@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
private void encryptBytes(byte[] plain, int encryptOffset, OutputStream bos) throws IOException { try { EncryptionInfo ei = getEncryptionInfo(); Encryptor enc = ei.getEncryptor(); enc.setChunkSize(RC4_REKEYING_INTERVAL); ChunkedCipherOutputStream os = enc.getDataStream(bos, 0); if (encryptOffset > 0) { os.writePlain(plain, 0, encryptOffset); } os.write(plain, encryptOffset, plain.length-encryptOffset); os.close(); } catch (GeneralSecurityException e) { throw new IOException(e); } }
@Override public void write(int b) throws IOException { write(new byte[]{(byte)b}); }
@Override public void write(byte[] b, int off, int len) throws IOException { write(b, off, len, false); }
public void writePlain(byte[] b, int off, int len) throws IOException { write(b, off, len, true); }
@Override public void write(byte[] b, int off, int len) throws IOException { write(b, off, len, false); }
@Override public void write(int b) throws IOException { write(new byte[]{(byte)b}); }
@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
public void writePlain(byte[] b, int off, int len) throws IOException { write(b, off, len, true); }
ccos.write(pictstream, offset, 8); ccos.flush(); offset += 8; ccos.write(pictstream, offset, part); ccos.flush(); offset += part; ccos.write(pictstream, offset, cbName); ccos.flush(); offset += cbName; ccos.write(pictstream, offset, 8); ccos.flush(); offset += 8; ccos.write(pictstream, offset, 16); // rgbUid 1/2 ccos.flush(); offset += 16; ccos.write(pictstream, offset, 34); // metafileHeader offset += 34; ccos.flush(); } else { ccos.write(pictstream, offset, 1); // tag offset += 1; ccos.flush(); ccos.write(pictstream, offset, blipLen);