public static byte[] convertToBytes(boolean b) {
        byte[] rVal = new byte[1];
        rVal[0] = b ? (byte)1 : (byte)0;
        return rVal;
    }
Writes a boolean out to an OutputStream.

@param outputStream
           The OutputStream the boolean will be written to
@param bVal
           The boolean to write
@throws IOException
            Thrown if there is a problem writing to the OutputStream
jme3-core/src/plugins/java/com/jme3/export/binary/ByteUtils.java