Class InputHelper

java.lang.Object
com.pnfsoftware.jeb.core.input.InputHelper

public class InputHelper extends Object
Static helper methods for IInput.
  • Constructor Details

    • InputHelper

      public InputHelper()
  • Method Details

    • wrapBytes

      public static IInput wrapBytes(byte[] data)
      Create or retrieve an input object wrapping a given byte array.
      Parameters:
      data - the data array to be wrapped, cannot be null
      Returns:
      a new or existing input object wrapping data
    • readBytes

      public static int readBytes(IInput src, long srcOffset, byte[] dst, int dstOffset, int size) throws IOException
      Convenience method to read bytes from an input source.
      Parameters:
      src - source input
      srcOffset - offset within the source
      dst - destination array
      dstOffset - offset within the destination where bytes will be written
      size - count of bytes to read from the source and write to the destination
      Returns:
      the number of bytes that were actually read, -1 if there is no more bytes to be read
      Throws:
      IOException - on IO error