Class IO

java.lang.Object
com.adobe.internal.io.stream.IO

public final class IO extends Object
Contains static utility functions for working with both IO classes.
  • Method Details

    • copy

      public static final long copy(InputStream is, OutputStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies the source InputStream to the destination OuputStream.
      Parameters:
      is - InputStream to be copied
      os - OutputSream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(InputStream is, long length, OutputStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies length number of bytes from the InputStream to the destination OuputStream.
      Parameters:
      is - InputByteStream to be copied
      length - The amount of bytes to be copies
      os - OutputTream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(BitInputStream is, OutputStream os, int bitsPerValue) throws IOException
      Only for internal engineering use. This api can change without notice. Parses the passed BitInputStream based on bitsPerValue and fills destination OuputStream with the parsed values.
      Parameters:
      is - BitInputStream to be copied
      os - OutputSream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(BitInputStream is, long length, OutputStream os, int bitsPerValue) throws IOException
      Copies length number of samples each with bits "bitsPerValue" from BitInputStream to the outputstream.
      Parameters:
      is -
      length -
      os -
      bitsPerValue -
      Returns:
      long Number of samples actually read.
      Throws:
      IOException
    • copy

      public static final long copy(InputByteStream is, OutputByteStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies the source InputStream to the destination OuputStream.
      Parameters:
      is - InputStream to be copied
      os - OutputTream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(InputByteStream is, OutputStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies the source InputStream to the destination OuputStream.
      Parameters:
      is - InputStream to be copied
      os - OutputTream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(InputByteStream is, long offset, long length, OutputByteStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies bytes from the InputByteStream to the destination OuputStream.
      Parameters:
      is - InputByteStream to be copied
      offset - The offset into the InputByteStream where the copy should begin
      length - The amount of bytes to be copies
      os - OutputTream to copy to
      Throws:
      IOException
    • copy

      public static final long copy(InputByteStream is, long offset, long length, OutputStream os, int blockSize) throws IOException
      Only for internal engineering use. This api can change without notice. Copies bytes from the InputByteStream to the destination OuputStream.
      Parameters:
      is - InputByteStream to be copied
      offset - The offset into the InputByteStream where the copy should begin
      length - The amount of bytes to be copied
      os - OutputStream to copy to
      blockSize - size of the block to use in copying
      Throws:
      IOException
    • copy

      public static final long copy(InputByteStream is, long offset, long length, OutputStream os) throws IOException
      Only for internal engineering use. This api can change without notice. Copies bytes from the InputByteStream to the destination OuputStream.
      Parameters:
      is - InputByteStream to be copied
      offset - The offset into the InputByteStream where the copy should begin
      length - The amount of bytes to be copies
      os - OutputTream to copy to
      Throws:
      IOException
    • longToByteArray

      public static final byte[] longToByteArray(long value, int width)
      Only for internal engineering use. This api can change without notice. This utility method converts an long to a byte array
      Parameters:
      value - - long value to be written
      width - - int number of bytes to be written
    • inputByteStreamToArray

      public static final byte[] inputByteStreamToArray(InputByteStream byteStream) throws IOException
      Only for internal engineering use. This api can change without notice. Obtains the InputByteStream's content as a byte array. Generally it is a bad idea to copy the whole stream's content into memory but for the text streams this is the only way to convert the text stream's content to Unicode from PDFDocEncoding or UCS-2.
      Returns:
      byte array in memory that contains the complete byte sequence in the stream.
      Throws:
      IOException
    • copy

      public static long copy(InputStream is, OutputByteStream obs) throws IOException
      Only for internal engineering use. This api can change without notice. Copies the source InputStream to the destination OuputStream.
      Parameters:
      is - InputStream to be copied
      obs - OutputByteSream to copy to
      Throws:
      IOException
    • compareInputByteStreams

      public static int compareInputByteStreams(InputByteStream stream1, InputByteStream stream2) throws IOException
      Compare two InputByteStream instances on a byte for byte basis. This compares the two streams from their current positions until the end of the streams. When this method returns the position of the streams will be just beyond the point of failure. The comparison is on a byte level and the "lesser" stream is the one whose byte value at given position is of lower numeric value than the other stream or the stream which is shorter.
      Parameters:
      stream1 -
      stream2 -
      Returns:
      0 if the streams are equal; negative if stream1 is "less" than stream2; and positive if stream1 is "greater" than stream2
      Throws:
      IOException