Package java.io

Examples of java.io.DataOutputStream.writeShort()


                }

                // Add a RTCP header
                output.writeByte(0x80 | 0 | (rc & 0x1F));
                output.writeByte(packetType & 0xFF);
                output.writeShort(((packetSize) / 4) - 1);

                // If we are a sender, add sender stats
                if (we_sent)
                {
                    /* As specified in the RFC, we randomly pick a stream and send
View Full Code Here


                        }

                        output.writeInt((int) (stream.getSSRC() & 0xFFFFFFFF));
                        output.writeByte((int)(lossFraction & 0xFF));
                        output.writeByte((cumulativePacketLoss >> 16) & 0xFF);
                        output.writeShort((cumulativePacketLoss & 0xFFFF));
                        output.writeInt((int) (extendedHighestSequenceNumber & 0xFFFFFFFF));
                        output.writeInt((int) (jitter & 0xFFFFFFFF));
                        output.writeShort((int) (lsrMSW & 0xFFFF));
                        output.writeShort((int) ((lsrLSW >> 16) & 0xFFFF));
                        output.writeInt((int) (DLSR & 0xFFFFFFFF));
View Full Code Here

                        output.writeByte((int)(lossFraction & 0xFF));
                        output.writeByte((cumulativePacketLoss >> 16) & 0xFF);
                        output.writeShort((cumulativePacketLoss & 0xFFFF));
                        output.writeInt((int) (extendedHighestSequenceNumber & 0xFFFFFFFF));
                        output.writeInt((int) (jitter & 0xFFFFFFFF));
                        output.writeShort((int) (lsrMSW & 0xFFFF));
                        output.writeShort((int) ((lsrLSW >> 16) & 0xFFFF));
                        output.writeInt((int) (DLSR & 0xFFFFFFFF));
                    }
                }
View Full Code Here

                        output.writeByte((cumulativePacketLoss >> 16) & 0xFF);
                        output.writeShort((cumulativePacketLoss & 0xFFFF));
                        output.writeInt((int) (extendedHighestSequenceNumber & 0xFFFFFFFF));
                        output.writeInt((int) (jitter & 0xFFFFFFFF));
                        output.writeShort((int) (lsrMSW & 0xFFFF));
                        output.writeShort((int) ((lsrLSW >> 16) & 0xFFFF));
                        output.writeInt((int) (DLSR & 0xFFFFFFFF));
                    }
                }

                writeSDESPacket(output);
View Full Code Here

                }

                // Send a empty RR/SR packet ( must be always the first rtcp packet in a compound packet )
                output.writeByte(0x80);
                output.writeByte(packetType & 0xFF);
                output.writeShort(packetSize);

                if ( we_sent )
                {
                    writeSenderInfo(output, sendStream);
                }
View Full Code Here

                }

                // Send a goodbye packet ( must be the last packet in a compound packet )
                output.writeByte(0x81);
                output.writeByte(RTCPPacket.PT_BYE & 0xFF);
                output.writeShort(byelen / 4);
                output.writeInt((int)(ssrc & 0xFFFFFFFF));

                // Goodbye RTCP Packet, send the reason for leaving
                if ( (null != reason) && (reason.length() > 0) )
                {
View Full Code Here

          tsig.applyStream(response, qtsig, first);
          qtsig = response.getTSIG();
        }
        first = false;
        byte[] out = response.toWire();
        dataOut.writeShort(out.length);
        dataOut.write(out);
      }
    } catch (IOException ex) {
      log.warn("AXFR failed", ex);
    }
View Full Code Here

          }
        } catch (IOException e) {
          response = this.eagleDNS.formerrMessage(in);
        }
        dataOut = new DataOutputStream(socket.getOutputStream());
        dataOut.writeShort(response.length);
        dataOut.write(response);
      } catch (IOException e) {

        log.debug("Error sending TCP response to " + socket.getRemoteSocketAddress() + ":" + socket.getPort() + ", " + e);
View Full Code Here

    }
 
    DataOutputStream dos = new DataOutputStream(out);
    dos.writeByte(getPacketType());
    dos.writeByte(getPacketIdentifier());
    dos.writeShort(packetLength);
    dos.write(getAuthenticator());
    dos.write(attributes);
    dos.flush();
  }
View Full Code Here

  static ByteBuffer toByteBufferV2(TransactionEventRecord record) {
    ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(512);
    DataOutputStream dataOutput = new DataOutputStream(byteOutput);
    try {
      dataOutput.writeInt(MAGIC_HEADER);
      dataOutput.writeShort(record.getRecordType());
      dataOutput.writeLong(record.getTransactionID());
      dataOutput.writeLong(record.getLogWriteOrderID());
      record.write(dataOutput);
      dataOutput.flush();
      // TODO toByteArray does an unneeded copy
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.