org.apache.avro.grpc

## Class AvroInputStream.CountingOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.avro.grpc.AvroInputStream.CountingOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable
  Enclosing class:
    AvroInputStream

      protected static class AvroInputStream.CountingOutputStream
      extends OutputStream

  An `OutputStream` that writes to a target `OutputStream` and provides total number of bytes written to it.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CountingOutputStream(OutputStream target)`

  - ### Method Summary

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

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

      `write`

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

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

- - ### Constructor Detail

    - #### CountingOutputStream

          public CountingOutputStream(OutputStream target)

  - ### Method Detail

    - #### write

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

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

    - #### write

          public void write(int b)
                     throws IOException

      Specified by:
        `write` in class `OutputStream`
      Throws:
        `IOException`

    - #### flush

          public void flush()
                     throws IOException

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

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `OutputStream`
      Throws:
        `IOException`

    - #### getWrittenCount

          public int getWrittenCount()

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.