Package kilim.nio

Class ExposedBais

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ExposedBais
    extends java.io.ByteArrayInputStream
    A hack that exposes the bytearray inside the ByteArrayInputStream. This is to avoid copying the byte array when toByteArray() is called
    • Field Summary

      • Fields inherited from class java.io.ByteArrayInputStream

        buf, count, mark, pos
    • Constructor Summary

      Constructors 
      Constructor Description
      ExposedBais​(byte[] buf)  
      ExposedBais​(byte[] buf, int offset, int length)  
      ExposedBais​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setCount​(int n)  
      byte[] toByteArray()  
      • Methods inherited from class java.io.ByteArrayInputStream

        available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.io.InputStream

        nullInputStream, read, readNBytes
      • Methods inherited from class java.lang.Object

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

      • ExposedBais

        public ExposedBais​(int size)
      • ExposedBais

        public ExposedBais​(byte[] buf,
                           int offset,
                           int length)
      • ExposedBais

        public ExposedBais​(byte[] buf)
    • Method Detail

      • toByteArray

        public byte[] toByteArray()
      • setCount

        public void setCount​(int n)