Class Base64InputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.simpleframework.common.encode.Base64InputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class Base64InputStream extends java.io.InputStream
TheBase64InputStream
is used to read base64 text in the form of a string through a conventional input stream. This is provided for convenience so that it is possible to encode and decode binary data as base64 for implementations that would normally use a binary format.- Author:
- Niall Gallagher
- See Also:
Base64Encoder
-
-
Constructor Summary
Constructors Constructor Description Base64InputStream(java.lang.String source)
Constructor for theBase64InputStream
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
This is used to read the next byte decoded from the text.int
read(byte[] array, int offset, int length)
This is used to read the next byte decoded from the text.java.lang.String
toString()
This returns the original base64 text that was encoded.
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
This is used to read the next byte decoded from the text. If the data has been fully consumed then this will return the standard -1.- Specified by:
read
in classjava.io.InputStream
- Returns:
- this returns the next octet decoded
- Throws:
java.io.IOException
-
read
public int read(byte[] array, int offset, int length) throws java.io.IOException
This is used to read the next byte decoded from the text. If the data has been fully consumed then this will return the standard -1.- Overrides:
read
in classjava.io.InputStream
- Parameters:
array
- this is the array to decode the text tooffset
- this is the offset to decode in to the arraythis
- is the number of bytes available to decode to- Returns:
- this returns the number of octets decoded
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
This returns the original base64 text that was encoded. This is useful for debugging purposes to see the source data.- Overrides:
toString
in classjava.lang.Object
- Returns:
- this returns the original base64 text to decode
-
-