Class FastByteArrayInputStream

java.lang.Object
java.io.InputStream
com.espertech.esper.common.internal.serde.serdeset.builtin.FastByteArrayInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class FastByteArrayInputStream extends InputStream
Fast byte array input stream, does not synchronize or check buffer overflow.
  • Constructor Details

    • FastByteArrayInputStream

      public FastByteArrayInputStream(byte[] buffer)
      Ctor.
      Parameters:
      buffer - to use
    • FastByteArrayInputStream

      public FastByteArrayInputStream(byte[] buffer, int offset, int length)
      Ctor.
      Parameters:
      buffer - buffer to use
      offset - offset to start at
      length - length of buffer to use
  • Method Details

    • getBytes

      public final byte[] getBytes()
      Returns the buffer.
      Returns:
      buffer
    • getLength

      public final int getLength()
      Returns buffer length.
      Returns:
      length
    • getOffset

      public final int getOffset()
      Returns buffer offset.
      Returns:
      offset
    • setBytes

      public void setBytes(byte[] bytes)
      Sets buffer.
      Parameters:
      bytes - to set
    • setLength

      public void setLength(int length)
      Set length of buffer.
      Parameters:
      length - buffer length
    • setOffset

      public void setOffset(int offset)
      Sets buffer offset.
      Parameters:
      offset - to set
    • read

      public int read(byte[] target, int offset, int length) throws IOException
      Read bytes to buffer.
      Overrides:
      read in class InputStream
      Parameters:
      target - target buffer
      offset - buffer offset
      length - buffer length
      Returns:
      number of bytes read
      Throws:
      IOException - indicates error
    • available

      public int available()
      Overrides:
      available in class InputStream
    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • read

      public int read(byte[] toBuf) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • reset

      public void reset()
      Overrides:
      reset in class InputStream
    • skip

      public long skip(long count)
      Overrides:
      skip in class InputStream
    • markSupported

      public boolean markSupported()
      Overrides:
      markSupported in class InputStream
    • mark

      public void mark(int readLimit)
      Overrides:
      mark in class InputStream
    • skipFast

      public final void skipFast(int count)
      Fast skip.
      Parameters:
      count - bytes to skip
    • readFast

      public final int readFast()
      Fast read without sync.
      Returns:
      read byte
    • readFast

      public final int readFast(byte[] target)
      Read bytes.
      Parameters:
      target - to fill
      Returns:
      num bytes
    • readFast

      public final int readFast(byte[] target, int offset, int length)
      Read bytes.
      Parameters:
      target - to fill
      offset - to fill
      length - length to use
      Returns:
      num bytes read