org.apache.hadoop.io.file.tfile

## Class SimpleBufferedOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - org.apache.hadoop.io.file.tfile.SimpleBufferedOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class SimpleBufferedOutputStream
      extends FilterOutputStream

  A simplified BufferedOutputStream with borrowed buffer, and allow users to see how much data have been buffered.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `buf`
    `protected int` | `count`

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleBufferedOutputStream(OutputStream out, byte[] buf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `flush()`
    `int` | `size()`
    `void` | `write(byte[] b, int off, int len)`
    `void` | `write(int b)`

    - ### Methods inherited from class java.io.FilterOutputStream

      `close, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### buf

          protected byte[] buf

    - #### count

          protected int count

  - ### Constructor Detail

    - #### SimpleBufferedOutputStream

          public SimpleBufferedOutputStream(OutputStream out,
                                            byte[] buf)

  - ### Method Detail

    - #### write

          public void write(int b)
                     throws IOException

      Overrides:
        `write` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### write

          public void write(byte[] b,
                            int off,
                            int len)
                     throws IOException

      Overrides:
        `write` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### flush

          public void flush()
                     throws IOException

      Specified by:
        `flush` in interface `Flushable`
      Overrides:
        `flush` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### size

          public int size()

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.