Package com.adobe.internal.io.stream
Class InputByteStreamImpl
java.lang.Object
com.adobe.internal.io.stream.InputByteStreamImpl
- All Implemented Interfaces:
InputByteStream
- Direct Known Subclasses:
PaddedInputByteStream,RangeInputByteStream
Only for internal engineering use. This api can change without notice.
-
Field Summary
Fields inherited from interface com.adobe.internal.io.stream.InputByteStream
EOF -
Method Summary
Modifier and TypeMethodDescriptionlongOnly for internal engineering use.abstract voidclose()Closes this InputByteStream and releases any system resources associated with the stream.booleaneof()Only for internal engineering use.abstract longOnly for internal engineering use.abstract longlength()Only for internal engineering use.abstract intread()Only for internal engineering use.intread(byte[] bytes) Only for internal engineering use.abstract intread(byte[] bytes, int position, int length) Only for internal engineering use.abstract InputByteStreamseek(long position) Only for internal engineering use.slice()Only for internal engineering use.abstract InputByteStreamslice(long begin, long length) Only for internal engineering use.Create an InputStream that represents the same data as this InputByteStream.toString()Only for internal engineering use.intunget()Only for internal engineering use.
-
Method Details
-
slice
Only for internal engineering use. This api can change without notice. Create a newInputByteStreamthat that provides another view on the underlying data. This newInputByteStreamis completely independent and can be read from and positioned without affecting the original or any other sliceInputByteStreamobjects. The initial position of the slice is at zero - the beginning of the slice.- Specified by:
slicein interfaceInputByteStream- Parameters:
begin- Offset within the currentInputByteStreamto start the slice.length- The length of the slice.- Returns:
- A slice of the original
InputByteStream. - Throws:
IOException
-
slice
Only for internal engineering use. This api can change without notice. Create a newInputByteStreamthat that provides another view on the underlying data. This newInputByteStreamis completely independent and can be read from and positioned without affecting the original or any other sliceInputByteStreamobjects. The initial position of the slice is at zero - the beginning of the slice. The slice has the same bounds as the originalInputByteStream. One common but probably incorrect usage of this method is to create a temporary "view" on the data that is used briefly within a method and then discarded. This is pretty wasteful and creates a number of small objects. In that case it would be better to find the current position usinggetPosition()and store it locally in the method and then restore the position withsetPosition()before returning from the method.- Specified by:
slicein interfaceInputByteStream- Returns:
- A slice of the original
InputByteStream. - Throws:
IOException
-
read
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. Read the byte at the current position. If the current position is at or beyond the end of the underlying data return a-1. If not beyond the end of the underlying data the current position is incremented by 1.- Specified by:
readin interfaceInputByteStream- Returns:
- The byte at the current position or
-1if at or beyond EOF. - Throws:
IOException
-
read
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. Read an array of bytes starting at the current position. The position is incremented by the length of the array that has been read.- Specified by:
readin interfaceInputByteStream- Parameters:
bytes- The destination array.position- The offset in the byte array to put the first byte read.length- The number of bytes to read.- Throws:
IOException
-
read
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. Read an array of bytes starting at the current position. The position is incremented by the length of the array that has been read.- Specified by:
readin interfaceInputByteStream- Parameters:
bytes- The destination array.- Throws:
IOException
-
unget
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. "Unget" the byte from underlying data. This essentially returns the byte just before the current position and sets the current position to point at that byte (one before the current position).- Specified by:
ungetin interfaceInputByteStream- Throws:
IOException
-
seek
Only for internal engineering use. This api can change without notice. Set the current position in the underlying data. This position is pegged to be no less than zero and no greater than the length of the InputByteStream.- Specified by:
seekin interfaceInputByteStream- Parameters:
position- Where to set the current position.- Returns:
- This object.
- Throws:
IOException
-
getPosition
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. Get the current position.- Specified by:
getPositionin interfaceInputByteStream- Returns:
- The current position.
- Throws:
IOException
-
length
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. The maximum number of bytes that can be read from thisInputByteStream.- Specified by:
lengthin interfaceInputByteStream- Returns:
- Total number of bytes available in this
InputByteStream. - Throws:
IOException
-
bytesAvailable
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. The number of bytes available to be read from the current position.- Specified by:
bytesAvailablein interfaceInputByteStream- Returns:
- Number of bytes available from the current position in this
InputByteStream. - Throws:
IOException
-
eof
Description copied from interface:InputByteStreamOnly for internal engineering use. This api can change without notice. Is the current position of thisInputByteStreamat or beyond the end of the underlying data.- Specified by:
eofin interfaceInputByteStream- Returns:
- True if the current position is beyond the end of the underlying data, false otherwise.
- Throws:
IOException
-
close
Description copied from interface:InputByteStreamCloses this InputByteStream and releases any system resources associated with the stream. After this method is called then any further calls to this instance are errors.- Specified by:
closein interfaceInputByteStream- Throws:
IOException
-
toString
Only for internal engineering use. This api can change without notice. -
toInputStream
Description copied from interface:InputByteStreamCreate an InputStream that represents the same data as this InputByteStream. The new InputStream is independent of the InputByteStream and operations on one will not affect the other including closing of either stream.- Specified by:
toInputStreamin interfaceInputByteStream- Returns:
- an InputStream that refers to the same underlying data
- Throws:
IOException
-