Class DrainableByteArrayInputStream

java.lang.Object
java.io.InputStream
io.deephaven.extensions.barrage.util.DefensiveDrainable
io.deephaven.extensions.barrage.DrainableByteArrayInputStream
All Implemented Interfaces:
io.grpc.Drainable, io.grpc.KnownLength, Closeable, AutoCloseable

public class DrainableByteArrayInputStream extends DefensiveDrainable
  • Constructor Details

    • DrainableByteArrayInputStream

      public DrainableByteArrayInputStream(byte[] buf, int offset, int length)
  • Method Details

    • available

      public int available()
      Description copied from class: DefensiveDrainable
      A defensive drainable needs to override available. As opposed to the generic InputStream, this method must return the exact amount available.
      Specified by:
      available in interface io.grpc.KnownLength
      Overrides:
      available in class DefensiveDrainable
      Returns:
      the exact amount available
    • drainTo

      public int drainTo(OutputStream outputStream) throws IOException
      Throws:
      IOException