public class RFileCipherOutputStream extends CipherOutputStream
CipherOutputStream
to include a way to track the number of bytes that
have been encrypted by the stream. The write method also includes a mechanism to stop writing and
throw an exception if exceeding a maximum number of bytes is attempted.out
Constructor and Description |
---|
RFileCipherOutputStream(OutputStream os,
Cipher c)
Constructs a RFileCipherOutputStream
|
Modifier and Type | Method and Description |
---|---|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len)
Override of CipherOutputStream's write to count the number of bytes that have been encrypted.
|
void |
write(int b)
Override of CipherOutputStream's write for a single byte to count it.
|
close, flush
public RFileCipherOutputStream(OutputStream os, Cipher c)
os
- the OutputStream objectc
- an initialized Cipher objectpublic void write(byte[] b, int off, int len) throws IOException
write
in class CipherOutputStream
IOException
public void write(byte[] b) throws IOException
write
in class CipherOutputStream
IOException
public void write(int b) throws IOException
write
in class CipherOutputStream
IOException
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.