DataOutputStream

A DataOutputStream is a OutputStream that can write primitive types

Since

0.1.0

Parameters

output

The OutputStream to write to

Constructors

Link copied to clipboard
constructor(output: OutputStream)

Creates a DataOutputStream with the given OutputStream

Properties

Link copied to clipboard

The OutputStream to write to

Functions

Link copied to clipboard
open override fun close()

Closes the OutputStream

Link copied to clipboard
open override fun flush()

Flushes the OutputStream

Link copied to clipboard
open override fun write(b: Int)

Writes a single byte to the OutputStream

expect open fun write(b: ByteArray)

Writes b.length bytes from the specified byte array to this output stream. The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length).

expect open fun write(b: ByteArray, off: Int, len: Int)

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

Link copied to clipboard

Writes a boolean to the OutputStream

Link copied to clipboard
fun writeBooleanArray(b: Array<Boolean>, off: Int, len: Int)

Writes a byte array to the OutputStream

Link copied to clipboard
fun writeByte(b: Byte)

Writes a byte to the OutputStream

Link copied to clipboard
fun writeByteArray(b: Array<Byte>, off: Int, len: Int)
fun writeByteArray(b: ByteArray, off: Int, len: Int)

Writes a byte array to the OutputStream

Link copied to clipboard
fun writeChar(b: Char)

Writes a char to the OutputStream

Link copied to clipboard
fun writeCharArray(b: Array<Char>, off: Int, len: Int)
fun writeCharArray(b: CharArray, off: Int, len: Int)

Writes a char array to the OutputStream

Link copied to clipboard
fun writeCharArrayUTF8(b: Array<Char>, off: Int, len: Int)
fun writeCharArrayUTF8(b: CharArray, off: Int, len: Int)

Writes a char array to the OutputStream

Link copied to clipboard

Writes a char to the OutputStream using UTF-8

Link copied to clipboard

Writes a double to the OutputStream

Link copied to clipboard
fun writeDoubleArray(b: Array<Double>, off: Int, len: Int)
fun writeDoubleArray(b: DoubleArray, off: Int, len: Int)

Writes a double array to the OutputStream

Link copied to clipboard

Writes a float to the OutputStream

Link copied to clipboard
fun writeFloatArray(b: Array<Float>, off: Int, len: Int)
fun writeFloatArray(b: FloatArray, off: Int, len: Int)

Writes a float array to the OutputStream

Link copied to clipboard
fun writeInt(b: Int)

Writes an int to the OutputStream

Link copied to clipboard
fun writeIntArray(b: Array<Int>, off: Int, len: Int)
fun writeIntArray(b: IntArray, off: Int, len: Int)

Writes an int array to the OutputStream

Link copied to clipboard
fun writeLong(b: Long)

Writes a long to the OutputStream

Link copied to clipboard
fun writeLongArray(b: Array<Long>, off: Int, len: Int)
fun writeLongArray(b: LongArray, off: Int, len: Int)

Writes a long array to the OutputStream

Link copied to clipboard

Writes a short to the OutputStream

Link copied to clipboard
fun writeShortArray(b: Array<Short>, off: Int, len: Int)
fun writeShortArray(b: ShortArray, off: Int, len: Int)

Writes a short array to the OutputStream

Link copied to clipboard
fun writeStringUTF8(str: CharSequence, off: Int, len: Int)

Writes a string to the OutputStream

Link copied to clipboard

Writes an unsigned byte to the OutputStream

Link copied to clipboard
Link copied to clipboard

Writes an unsigned int to the OutputStream

Link copied to clipboard
Link copied to clipboard

Writes an unsigned long to the OutputStream

Link copied to clipboard
Link copied to clipboard

Writes an unsigned short to the OutputStream

Link copied to clipboard
Link copied to clipboard
fun writeUTF8(str: CharSequence, off: Int, len: Int)

Writes a string to the OutputStream