Java ByteBuffer Read readBoolean(ByteBuffer buff)

Here you can find the source of readBoolean(ByteBuffer buff)

Description

Reads one byte as a boolean.

License

LGPL

Declaration

public static boolean readBoolean(ByteBuffer buff) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.nio.ByteBuffer;

public class Main {
    /**//from ww  w  .  j  av a 2s  .co  m
     * Reads one byte as a boolean. Its value is true if 1 and false if 0
     */
    public static boolean readBoolean(ByteBuffer buff) {
        return buff.get() == 1;
    }
}

Related

  1. readAlexString(ByteBuffer buffer)
  2. readAllLeftBytes(ByteBuffer buffer)
  3. readASCII(ByteBuffer buffer)
  4. readAsciiString(MappedByteBuffer buffer, int pos, int length)
  5. readBE(ByteBuffer bb, int elementWidth)
  6. readBooleanArray(ByteBuffer in)
  7. readBuf(ByteBuffer buffer)
  8. readBuffer(ByteChannel channel, ByteBuffer buffer)
  9. readBufferFully(FileChannel fc, ByteBuffer buf, int startPos)