Class ZeroTierOutputStream

java.lang.Object
java.io.OutputStream
com.zerotier.sockets.ZeroTierOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

public class ZeroTierOutputStream
extends java.io.OutputStream
Extends OutputStream using ZeroTier as a transport
  • Field Summary

    Fields
    Modifier and Type Field Description
    int zfd
    File descriptor used by lower native layer.
  • Constructor Summary

    Constructors
    Constructor Description
    ZeroTierOutputStream()  
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close the stream
    void write​(byte[] originBuffer)
    Write a buffer
    void write​(byte[] originBuffer, int offset, int numBytes)
    Write a buffer at offset
    void write​(int d)
    Write low byte

    Methods inherited from class java.io.OutputStream

    flush, nullOutputStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • zfd

      public int zfd
      File descriptor used by lower native layer. No touch!
  • Constructor Details

    • ZeroTierOutputStream

      public ZeroTierOutputStream()
  • Method Details

    • close

      public void close() throws java.io.IOException
      Close the stream
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Overrides:
      close in class java.io.OutputStream
      Throws:
      java.io.IOException - when an I/O error occurs
    • write

      public void write​(byte[] originBuffer) throws java.io.IOException
      Write a buffer
      Overrides:
      write in class java.io.OutputStream
      Parameters:
      originBuffer - Source buffer
      Throws:
      java.io.IOException - when an I/O error occurs
    • write

      public void write​(byte[] originBuffer, int offset, int numBytes) throws java.io.IOException
      Write a buffer at offset
      Overrides:
      write in class java.io.OutputStream
      Parameters:
      originBuffer - Source buffer
      offset - Where in the buffer to start
      numBytes - Number of bytes to write
      Throws:
      java.io.IOException - when an I/O error occurs
    • write

      public void write​(int d) throws java.io.IOException
      Write low byte
      Specified by:
      write in class java.io.OutputStream
      Parameters:
      d - Integer containing low byte to write
      Throws:
      java.io.IOException - when an I/O error occurs