Package dev.latvian.mods.klib.io
Record Class ByteOutput.OfStream
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.ByteOutput.OfStream
- All Implemented Interfaces:
ByteOutput,Closeable,AutoCloseable
- Enclosing interface:
ByteOutput
public static record ByteOutput.OfStream(OutputStream out)
extends Record
implements ByteOutput, Closeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.latvian.mods.klib.io.ByteOutput
ByteOutput.OfBuffer, ByteOutput.OfData, ByteOutput.OfStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final booleanIndicates whether some other object is "equal to" this one.voidflush()final inthashCode()Returns a hash code value for this object.out()Returns the value of theoutrecord component.byte[]final StringtoString()Returns a string representation of this record class.voidwriteAll(byte[] value) voidwriteAll(byte[] value, int offset, int len) voidwriteByte(byte value) voidwriteUByte(int value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.io.ByteOutput
writeByteArray, writeDouble, writeExactTime, writeFloat, writeInt, writeLong, writeShort, writeUShort, writeUTF, writeUUID, writeVarInt, writeVarLong
-
Constructor Details
-
OfStream
Creates an instance of aOfStreamrecord class.- Parameters:
out- the value for theoutrecord component
-
-
Method Details
-
writeByte
- Specified by:
writeBytein interfaceByteOutput- Throws:
IOException
-
flush
- Specified by:
flushin interfaceByteOutput- Throws:
IOException
-
writeUByte
- Specified by:
writeUBytein interfaceByteOutput- Throws:
IOException
-
writeAll
- Specified by:
writeAllin interfaceByteOutput- Throws:
IOException
-
writeAll
- Specified by:
writeAllin interfaceByteOutput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toByteArray
- Specified by:
toByteArrayin interfaceByteOutput- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
out
Returns the value of theoutrecord component.- Returns:
- the value of the
outrecord component
-