Package com.zerotier.sockets
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
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 zfdFile descriptor used by lower native layer. No touch!
-
-
Constructor Details
-
ZeroTierOutputStream
public ZeroTierOutputStream()
-
-
Method Details
-
close
public void close() throws java.io.IOExceptionClose the stream- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
- when an I/O error occurs
-
write
public void write(byte[] originBuffer) throws java.io.IOExceptionWrite a buffer- Overrides:
write
in classjava.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.IOExceptionWrite a buffer at offset- Overrides:
write
in classjava.io.OutputStream
- Parameters:
originBuffer
- Source bufferoffset
- Where in the buffer to startnumBytes
- Number of bytes to write- Throws:
java.io.IOException
- when an I/O error occurs
-
write
public void write(int d) throws java.io.IOExceptionWrite low byte- Specified by:
write
in classjava.io.OutputStream
- Parameters:
d
- Integer containing low byte to write- Throws:
java.io.IOException
- when an I/O error occurs
-