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 intzfdFile descriptor used by lower native layer. -
Constructor Summary
Constructors Constructor Description ZeroTierOutputStream() -
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStreamMethods 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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein 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:
writein 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:
writein 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:
writein classjava.io.OutputStream- Parameters:
d- Integer containing low byte to write- Throws:
java.io.IOException- when an I/O error occurs
-