Package snap.viewx

Class ScanPane.BytesInputStream

java.lang.Object
java.io.InputStream
snap.viewx.ScanPane.BytesInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
ScanPane

public static class ScanPane.BytesInputStream extends InputStream
An InputStream that lets you add bytes on the fly.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BytesInputStream(byte[] buf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] theBytes)
    Adds bytes to stream.
    void
    add(String aStr)
    Adds string to stream.
    int
    Returns the number of remaining bytes that can be read (or skipped over) from this input stream.
    void
    Closing a BytesArrayInputStream has no effect.
    void
    mark(int readAheadLimit)
    Set the current marked position in the stream.
    boolean
    Tests if this InputStream supports mark/reset.
    int
    Reads the next byte of data from this input stream.
    int
    read(byte[] theBytes, int off, int len)
    Reads up to len bytes of data into an array of bytes from this input stream.
    void
    Resets the buffer to the marked position.
    long
    skip(long n)
    Skips n bytes of input from this input stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BytesInputStream

      public BytesInputStream(byte[] buf)
  • Method Details

    • add

      public void add(String aStr)
      Adds string to stream.
    • add

      public void add(byte[] theBytes)
      Adds bytes to stream.
    • read

      public int read()
      Reads the next byte of data from this input stream.
      Specified by:
      read in class InputStream
    • read

      public int read(byte[] theBytes, int off, int len)
      Reads up to len bytes of data into an array of bytes from this input stream.
      Overrides:
      read in class InputStream
    • skip

      public long skip(long n)
      Skips n bytes of input from this input stream.
      Overrides:
      skip in class InputStream
    • available

      public int available()
      Returns the number of remaining bytes that can be read (or skipped over) from this input stream.
      Overrides:
      available in class InputStream
    • markSupported

      public boolean markSupported()
      Tests if this InputStream supports mark/reset.
      Overrides:
      markSupported in class InputStream
    • mark

      public void mark(int readAheadLimit)
      Set the current marked position in the stream.
      Overrides:
      mark in class InputStream
    • reset

      public void reset()
      Resets the buffer to the marked position.
      Overrides:
      reset in class InputStream
    • close

      public void close() throws IOException
      Closing a BytesArrayInputStream has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException