public class UserAttributeSubpacketInputStream extends java.io.InputStream implements UserAttributeSubpacketTags
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SUBPACKET_LEN
Hard upper bound on a single user-attribute subpacket body.
|
IMAGE_ATTRIBUTE| Constructor and Description |
|---|
UserAttributeSubpacketInputStream(java.io.InputStream in) |
UserAttributeSubpacketInputStream(java.io.InputStream in,
int limit) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
int |
read() |
UserAttributeSubpacket |
readPacket() |
public static final int MAX_SUBPACKET_LEN
StreamUtil.findLimit(InputStream), which for the non-seekable
streams used during packet parsing returns close to the JVM heap size and so does not bound
the per-packet allocation. Without it a crafted 4-octet length header could force a
multi-gigabyte new byte[] before any body bytes are read. 2 MiB matches the ceiling
used for signature subpackets (SignaturePacket.MAX_SUBPACKET_LEN) and public-key
packets (PublicKeyPacket.MAX_LEN); user-attribute (image) subpackets are not
expected to approach it.public UserAttributeSubpacketInputStream(java.io.InputStream in)
public UserAttributeSubpacketInputStream(java.io.InputStream in,
int limit)
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic UserAttributeSubpacket readPacket() throws java.io.IOException
java.io.IOException