Package ghidra.pty.windows

# Class HandleOutputStream

java.lang.Object
java.io.OutputStream
ghidra.pty.windows.HandleOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public class HandleOutputStream extends OutputStream

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HandleOutputStream(Handle handle)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `flush()`
  `protected boolean`
  `isBuffered()`
  Check whether this handle has buffered output
  `void`
  `write(byte[] b)`
  `void`
  `write(byte[] b, int off, int len)`
  `void`
  `write(int b)`

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

  `nullOutputStream`

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

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

- ## Constructor Details

  - ### HandleOutputStream

    public HandleOutputStream(Handle handle)

- ## Method Details

  - ### write

    public void write(int b) throws IOException
    Specified by:
      `write` in class `OutputStream`
    Throws:
      `IOException`

  - ### write

    public void write(byte[] b) throws IOException
    Overrides:
      `write` in class `OutputStream`
    Throws:
      `IOException`

  - ### write

    public void write(byte[] b, int off, int len) throws IOException
    Overrides:
      `write` in class `OutputStream`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `OutputStream`
    Throws:
      `IOException`

  - ### isBuffered

    protected boolean isBuffered()
    Check whether this handle has buffered output

    Windows can get touchy when trying to flush handles that are not actually buffered. If the wrapped handle is not buffered, then this method must return false, otherwise, any attempt to flush this stream will result in `ERROR_INVALID_HANDLE`.

    Returns:

  - ### flush

    public void flush() throws IOException
    Specified by:
      `flush` in interface `Flushable`
    Overrides:
      `flush` in class `OutputStream`
    Throws:
      `IOException`