| | |
| | | return (state != ASN1.ELEMENT_READ_STATE_NEED_TYPE) || needTypeState(true); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int peekLength() throws IOException { |
| | | peekType(); |
| | | |
| | |
| | | return peekLength; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public byte peekType() throws IOException { |
| | | if (state == ASN1.ELEMENT_READ_STATE_NEED_TYPE) { |
| | | needTypeState(false); |
| | |
| | | return peekType; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean readBoolean() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | return readByte != 0x00; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void readEndSequence() throws IOException { |
| | | readLimiter = readLimiter.endSequence(); |
| | | |
| | |
| | | readEndSequence(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void readEndSet() throws IOException { |
| | | // From an implementation point of view, a set is equivalent to a |
| | | // sequence. |
| | | readEndSequence(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int readEnumerated() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | return (int) readInteger(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long readInteger() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void readNull() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | state = ASN1.ELEMENT_READ_STATE_NEED_TYPE; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ByteString readOctetString() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | return ByteString.wrap(value); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ByteStringBuilder readOctetString(final ByteStringBuilder builder) throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | return builder; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String readOctetStringAsString() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void readStartSequence() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |
| | |
| | | readStartSequence(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void readStartSet() throws IOException { |
| | | // From an implementation point of view, a set is equivalent to a |
| | | // sequence. |
| | | readStartSequence(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ASN1Reader skipElement() throws IOException { |
| | | // Read the header if haven't done so already |
| | | peekLength(); |