Top Inners Constructors Methods
org.apache.commons.compress.archivers.sevenz

pack-priv final Class AES256SHA256Decoder

extends AbstractCoder
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_16LE

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv InputStream
decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] passwordBytes, final int maxMemoryLimitInKb)

Implements abstract org.apache.commons.compress.archivers.sevenz.AbstractCoder.decode.

Decodes using stream that reads from in using the configured coder and password.
pack-priv OutputStream
encode(final OutputStream out, final Object options)

Overrides org.apache.commons.compress.archivers.sevenz.AbstractCoder.encode.

Encodes using a stream that writes to out using the given configuration.
pack-priv byte[]
getOptionsAsProperties(final Object options)

Overrides org.apache.commons.compress.archivers.sevenz.AbstractCoder.getOptionsAsProperties.

Gets property bytes to write in a Folder block.
pack-priv static byte[]
sha256Password(final byte[] password, final int numCyclesPower, final byte[] salt)

pack-priv static byte[]
sha256Password(final char[] password, final int numCyclesPower, final byte[] salt)

pack-priv static byte[]

Returns:

encoded characters
utf16Decode
(final char[]
characters to encode
chars
)

Convenience method that encodes Unicode characters into bytes in UTF-16 (little-endian byte order) charset

Inherited from org.apache.commons.compress.archivers.sevenz.AbstractCoder:
getOptionsFromCoderisOptionInstancetoInt

Constructor Detail

AES256SHA256Decoderback to summary
pack-priv AES256SHA256Decoder()

Method Detail

decodeback to summary
pack-priv InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] passwordBytes, final int maxMemoryLimitInKb)

Implements abstract org.apache.commons.compress.archivers.sevenz.AbstractCoder.decode.

Doc from org.apache.commons.compress.archivers.sevenz.AbstractCoder.decode.

Decodes using stream that reads from in using the configured coder and password.

Returns:InputStream

a stream that reads from in using the configured coder and password.

Annotations
@Override
encodeback to summary
pack-priv OutputStream encode(final OutputStream out, final Object options) throws IOException

Overrides org.apache.commons.compress.archivers.sevenz.AbstractCoder.encode.

Doc from org.apache.commons.compress.archivers.sevenz.AbstractCoder.encode.

Encodes using a stream that writes to out using the given configuration.

Returns:OutputStream

a stream that writes to out using the given configuration.

Annotations
@Override
Exceptions
IOException:
Optionally thrown by subclassses.
getOptionsAsPropertiesback to summary
pack-priv byte[] getOptionsAsProperties(final Object options) throws IOException

Overrides org.apache.commons.compress.archivers.sevenz.AbstractCoder.getOptionsAsProperties.

Doc from org.apache.commons.compress.archivers.sevenz.AbstractCoder.getOptionsAsProperties.

Gets property bytes to write in a Folder block.

Returns:byte[]

property bytes to write in a Folder block.

Annotations
@Override
Exceptions
IOException:
Optionally thrown by subclassses.
sha256Passwordback to summary
pack-priv static byte[] sha256Password(final byte[] password, final int numCyclesPower, final byte[] salt)
sha256Passwordback to summary
pack-priv static byte[] sha256Password(final char[] password, final int numCyclesPower, final byte[] salt)
utf16Decodeback to summary
pack-priv static byte[] utf16Decode(final char[] chars)

Convenience method that encodes Unicode characters into bytes in UTF-16 (little-endian byte order) charset

Parameters
chars:char[]

characters to encode

Returns:byte[]

encoded characters

Since
1.23
org.apache.commons.compress.archivers.sevenz back to summary

private final Class AES256SHA256Decoder.AES256SHA256DecoderInputStream

extends InputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private CipherInputStream
private final Coder
private final InputStream
private boolean
private final byte[]

Constructor Summary

AccessConstructor and Description
private
AES256SHA256DecoderInputStream(final InputStream in, final Coder coder, final String archiveName, final byte[] passwordBytes)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
private CipherInputStream
init()

public int
read()

Implements abstract java.io.InputStream.read.

Reads the next byte of data from the input stream.
public int
read(final byte[]
the buffer into which the data is read.
b
,
final int
the start offset in array b at which the data is written.
off
,
final int
the maximum number of bytes to read.
len
)

Overrides java.io.InputStream.read.

Reads up to len bytes of data from the input stream into an array of bytes.
Inherited from java.io.InputStream:
availablemarkmarkSupportednullInputStreamreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

archiveNameback to summary
private final String archiveName
cipherInputStreamback to summary
private CipherInputStream cipherInputStream
coderback to summary
private final Coder coder
inback to summary
private final InputStream in
isInitializedback to summary
private boolean isInitialized
passwordBytesback to summary
private final byte[] passwordBytes

Constructor Detail

AES256SHA256DecoderInputStreamback to summary
private AES256SHA256DecoderInputStream(final InputStream in, final Coder coder, final String archiveName, final byte[] passwordBytes)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.InputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
initback to summary
private CipherInputStream init() throws IOException
readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Doc from java.io.InputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Annotations
@SuppressWarnings:resource
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(final byte[] b, final int off, final int len) throws IOException

Overrides java.io.InputStream.read.

Doc from java.io.InputStream.read.

Reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read. The number of bytes actually read is returned as an integer.

This method blocks until input data is available, end of file is detected, or an exception is thrown.

If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, the value -1 is returned; otherwise, at least one byte is read and stored into b.

The first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, at most, equal to len. Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], leaving elements b[off+k] through b[off+len-1] unaffected.

In every case, elements b[0] through b[off-1] and elements b[off+len] through b[b.length-1] are unaffected.

Parameters
b:byte[]

the buffer into which the data is read.

off:int

the start offset in array b at which the data is written.

len:int

the maximum number of bytes to read.

Returns:int

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Annotations
@SuppressWarnings:resource
@Override
Exceptions
IOException:
If the first byte cannot be read for any reason other than end of file, or if the input stream has been closed, or if some other I/O error occurs.
org.apache.commons.compress.archivers.sevenz back to summary

private final Class AES256SHA256Decoder.AES256SHA256DecoderOutputStream

extends OutputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte[]
private final int
private final CipherOutputStream
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.
public void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out.
private void
public void
write(final byte[]
the data.
b
,
final int
the start offset in the data.
off
,
final int
the number of bytes to write.
len
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.
public void
write(final int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.
Inherited from java.io.OutputStream:
nullOutputStreamwrite

Field Detail

cipherBlockBufferback to summary
private final byte[] cipherBlockBuffer
cipherBlockSizeback to summary
private final int cipherBlockSize
cipherOutputStreamback to summary
private final CipherOutputStream cipherOutputStream
countback to summary
private int count

Constructor Detail

AES256SHA256DecoderOutputStreamback to summary
private AES256SHA256DecoderOutputStream(final AES256Options opts, final OutputStream out)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
flushback to summary
public void flush() throws IOException

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.OutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
flushBufferback to summary
private void flushBuffer() throws IOException
writeback to summary
public void write(final byte[] b, final int off, final int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
writeback to summary
public void write(final int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.