DataOutputStream writeBoolean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DataOutputStream writeBoolean method.

This code example shows how to use the following methods:writeBoolean, writeByte, writeShort, close
        try { 
            messageOutputStream = channelAssociation.acquireChannelMessageOutputStream();
        } catch (Exception e) {
            throw EjbMessages.MESSAGES.failedToOpenMessageOutputStream(e);
        } 
        dataOutputStream = new DataOutputStream(messageOutputStream);
        try { 
            // write header 
            dataOutputStream.writeByte(HEADER_TX_INVOCATION_RESPONSE);
            // write invocation id 
            dataOutputStream.writeShort(invocationId);
            // write a "bit" to indicate that this message contains the XAResource status for a "prepare" 
            // invocation 
            dataOutputStream.writeBoolean(true);
            // write the XAResource status 
            PackedInteger.writePackedInteger(dataOutputStream, xaResourceStatusCode);
        } finally { 
            channelAssociation.releaseChannelMessageOutputStream(messageOutputStream);
            dataOutputStream.close();
        } 

9
CodeRank
This code example shows how to use the following methods:writeBoolean, writeInt
		return pipeConnectionMatrix.isDirty() || textureMatrix.isDirty() || facadeMatrix.isDirty() || plugMatrix.isDirty();
	} 
 
	@Override 
	public void writeData(DataOutputStream data) throws IOException {
		data.writeBoolean(hasGate);
		data.writeInt(gateIconIndex);
		pipeConnectionMatrix.writeData(data);
		textureMatrix.writeData(data);
		wireMatrix.writeData(data);
		facadeMatrix.writeData(data);
		plugMatrix.writeData(data);
	} 
 
	@Override 
	public void readData(DataInputStream data) throws IOException {
		hasGate = data.readBoolean();
		gateIconIndex = data.readInt();
		pipeConnectionMatrix.readData(data);
		textureMatrix.readData(data);
8
CodeRank
This code example shows how to use the following methods:writeBoolean
   * @throws IOException if an IO error occurs or the compressor cannot be 
   * instantiated 
   */ 
  DataOutputStream writeHeaderAndWrapStream(OutputStream os)
  throws IOException { 
    DataOutputStream dos = new DataOutputStream(os);
 
    dos.writeBoolean(imageCodec != null);
 
    if (imageCodec != null) {
      String codecClassName = imageCodec.getClass().getCanonicalName();
      Text.writeString(dos, codecClassName);
 
      return new DataOutputStream(imageCodec.createOutputStream(os));
    } else { 
      // use a buffered output stream 
      return new DataOutputStream(new BufferedOutputStream(os));
    } 
  } 
 
8
CodeRank
This code example shows how to use the following methods:flush, writeBoolean, writeByte, writeDouble, writeFloat
  public void updateGround(boolean onGround) {
    this.onGround = onGround;
  } 
 
  public void send(DataOutputStream out) throws IOException {
    out.writeByte(0x0d);
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(stance);
    out.writeDouble(z);
    out.writeFloat(yaw);
    out.writeFloat(pitch);
    out.writeBoolean(onGround);
    out.flush();
  } 
 
  public Coordinate coordinate() { 
    return new Coordinate((int) x, (int) y, (int) z, dimension);
  } 
 
8
CodeRank
This code example shows how to use the following methods:write, writeBoolean, writeDouble, writeInt, writeUTF
7
CodeRank
This code example shows how to use the following methods:writeBoolean, writeInt, writeUTF, DataOutputStream.write
7
CodeRank
This code example shows how to use the following methods:flush, writeBoolean, writeByte, writeDouble, writeFloat
  public void updateGround(boolean onGround) {
    this.onGround = onGround;
  } 
 
  public void send(DataOutputStream out) throws IOException {
    out.writeByte(0x0d);
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(stance);
    out.writeDouble(z);
    out.writeFloat(yaw);
    out.writeFloat(pitch);
    out.writeBoolean(onGround);
    out.flush();
  } 
 
  public Coordinate coordinate() { 
    return new Coordinate((int) x, (int) y, (int) z, dimension);
  } 
 
7
CodeRank
This code example shows how to use the following methods:writeBoolean
        delegate.flush();
    } 
 
    @Override 
    public void writeBoolean(boolean v) throws IOException {
        delegate.writeBoolean(v);
    } 
 
    @Override 
    public void writeByte(int v) throws IOException {
        delegate.writeByte(v);
    } 
 
    @Override 
    public void writeShort(int v) throws IOException {
        delegate.writeShort(v);
    } 
 
    @Override 
    public void writeChar(int v) throws IOException {
7
CodeRank
This code example shows how to use the following methods:writeBoolean, writeByte, writeChar, writeDouble, writeFloat
    public void testBytesRead() throws Exception 
    { 
        byte[] testData;
 
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(baos);
        try 
        { 
            // boolean 
            out.writeBoolean(true);
            // byte 
            out.writeByte(0x1);
            // char 
            out.writeChar('a');
            // short 
            out.writeShort(1);
            // int 
            out.writeInt(1);
            // long 
            out.writeLong(1L);

7
CodeRank
This code example shows how to use the following methods:writeBoolean, writeInt, writeUTF, DataOutputStream.write
7
CodeRank
writeBoolean Method Overview
Writes a boolean to the underlying output stream as a 1-byte value.
See Code Examples for other Java 8 DataOutputStream Methods: