Skip to content

okio / okio / BufferedSource / readShortLe

readShortLe

(js, jvm, native) abstract fun readShortLe():Short

Removes two bytes from this source and returns a little-endian short.

Buffer buffer = new Buffer()
    .writeByte(0xff)
    .writeByte(0x7f)
    .writeByte(0x0f)
    .writeByte(0x00);
assertEquals(4, buffer.size());

assertEquals(32767, buffer.readShortLe());
assertEquals(2, buffer.size());

assertEquals(15, buffer.readShortLe());
assertEquals(0, buffer.size());