ZipShort

Utility class that represents a two byte integer with conversion rules for the little endian byte order of ZIP files.

Constructors

Link copied to clipboard
constructor(bytes: Array<Byte>)
Create instance from bytes.
constructor(bytes: Array<Byte>, offset: Int)
Create instance from the two bytes starting at offset.
constructor(value: Int)
Create instance from a number.

Properties

Link copied to clipboard
val value: Int
Link copied to clipboard
ZipShort with a value of 0.

Functions

Link copied to clipboard
open fun clone(): Any
Link copied to clipboard
open fun equals(o: Any): Boolean
Override to make two instances with same value equal.
Link copied to clipboard
open fun getBytes(): Array<Byte>
open fun getBytes(value: Int): Array<Byte>
Get value as two bytes in big endian byte order.
Link copied to clipboard
open fun getValue(bytes: Array<Byte>): Int
Helper method to get the value as a java int from a two-byte array
open fun getValue(bytes: Array<Byte>, offset: Int): Int
Helper method to get the value as a java int from two bytes starting at given array offset
Link copied to clipboard
open fun hashCode(): Int
Override to make two instances with same value equal.
Link copied to clipboard
open fun putShort(value: Int, buf: Array<Byte>, offset: Int)
put the value as two bytes in big endian byte order.
Link copied to clipboard
open fun toString(): String