类 ByteBufferOutputStream

  • 所有已实现的接口:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class ByteBufferOutputStream
    extends java.io.OutputStream
    A OutputStream that write date to ByteBuffer. After closed, the ByteBuffer contains the data can be get by getBuffer()
    • 构造器概要

      构造器 
      构造器 说明
      ByteBufferOutputStream​(boolean direct)
      Create a new ByteBufferOutputStream.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void close()  
      void flush()  
      java.nio.ByteBuffer getBuffer()
      Get the underlying ByteBuffer contains the result data ready for read.
      void write​(byte[] b)  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • 从类继承的方法 java.io.OutputStream

        nullOutputStream
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • ByteBufferOutputStream

        public ByteBufferOutputStream​(boolean direct)
        Create a new ByteBufferOutputStream.
        参数:
        direct - if use direct buffer
    • 方法详细资料

      • getBuffer

        public java.nio.ByteBuffer getBuffer()
        Get the underlying ByteBuffer contains the result data ready for read. This method should be called after close() method
        抛出:
        java.lang.IllegalStateException - if stream not closed.
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        覆盖:
        write 在类中 java.io.OutputStream
        抛出:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        覆盖:
        write 在类中 java.io.OutputStream
        抛出:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        指定者:
        flush 在接口中 java.io.Flushable
        覆盖:
        flush 在类中 java.io.OutputStream
        抛出:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        指定者:
        close 在接口中 java.lang.AutoCloseable
        指定者:
        close 在接口中 java.io.Closeable
        覆盖:
        close 在类中 java.io.OutputStream
        抛出:
        java.io.IOException
      • write

        public void write​(int b)
                   throws java.io.IOException
        指定者:
        write 在类中 java.io.OutputStream
        抛出:
        java.io.IOException