|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
com.kirkwarez.kirkpack.io.eoa.wdysv.WDYSVOutputStream
This stream streams in plain input data and streams out MYST V encrypted data. Note that a length attribute is required upon construction. This is because the WDYSV header requires the length of the unencrypted data to be set, and it cannot be determined from the stream. The encryption requires blocks of 16 bytes to work, and any padding will be done with zeroes.
Field Summary | |
protected static int |
BLOCKSIZE
The blocksize. |
private static byte[] |
KEY
The key. |
protected int |
length
The length of the unencrypted data. |
protected int |
total
The amount of bytes written out. |
static int |
WDYSV_HEADER
The WDYSV header. |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
WDYSVOutputStream(OutputStream output,
int length)
Creates a stream over the given stream. |
Method Summary | |
int |
getLength()
Returns the length of the unencrypted data, as written to the fileheader. |
protected void |
setLength(int length)
Sets the length of the unencrypted data, as written to the fileheader. |
void |
write(byte[] buffer,
int offset,
int length)
Writes the given byte array to the underlying steam using the given subselection. |
void |
write(int value)
Writes the given byte (well, int) to the underlying steam. |
protected void |
writePadding()
Writes out padding to fill up the blocksize. |
Methods inherited from class java.io.FilterOutputStream |
close, flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int length
protected int total
private static byte[] KEY
protected static final int BLOCKSIZE
public static final int WDYSV_HEADER
Constructor Detail |
public WDYSVOutputStream(OutputStream output, int length) throws IOException
output
- The stream to write to.length
- The length of the data that will be written into this stream
(needed for the header, and also for padding).
IOException
- When the given stream does not cooperate (we need to write the
header and the length attribute).Method Detail |
public void write(int value) throws IOException
value
- An int that represents a byte to be written out.
IOException
- When, you know, IO stuff.OutputStream.write(int)
public void write(byte[] buffer, int offset, int length) throws IOException
buffer
- The byte buffer with data.offset
- The starting point of where to start getting the data.length
- The amount of data to write, taken from offset on.
IOException
OutputStream.write(byte[], int, int)
protected void writePadding() throws IOException
IOException
- When writing fails and stuff.public int getLength()
protected void setLength(int length)
length
- The length of the unencrypted data.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |