Examples of writeShort()


Examples of java.io.DataOutputStream.writeShort()

                    return out_stream.toByteArray();
                }
                if(obj instanceof MethodCall) {
                    out.writeByte(METHOD_CALL);
                    MethodCall call=(MethodCall)obj;
                    out.writeShort(call.getId());
                    Object[] args=call.getArgs();
                    if(args == null || args.length == 0) {
                        out.writeShort(0);
                    }
                    else {
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

        dos.writeByte( (byte)0 ); // reserved
       
        dos.writeByte((byte)1);
        dos.write( new byte[4] );
       
        dos.writeShort( (short)delegate.getPort()); // port
       
        dos.flush();
       
        dis.readByte()// ver
       
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

          dos_temp.writeByte( (byte)mapped_ip.length() )// address type = domain name
          dos_temp.write( mapped_ip.getBytes() );
 
        }
 
        dos_temp.writeShort( (short)target.getPort() ); // port
 
        dos_temp.flush();
        packet_out_header = baos_temp.toByteArray();

             
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

      while (iterA.hasNext())
        outStream.writeInt(iterA.getIntNext());

    } else if (classType == short.class) {
      while (iterA.hasNext())
        outStream.writeShort(iterA.getShortNext());

    } else if (classType == char.class) {  // LOOK why are we using chars anyway ?
      byte[] pa = convertCharToByte((char[]) data.get1DJavaArray(char.class));
      outStream.write(pa, 0 , pa.length);
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

      while (iterA.hasNext())
        outStream.writeInt(iterA.getIntNext());

    } else if (classType == short.class) {
      while (iterA.hasNext())
        outStream.writeShort(iterA.getShortNext());

    } else if (classType == char.class) {
      while (iterA.hasNext())
        outStream.writeChar(iterA.getCharNext());
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

    @Test
    public void testGetPrimitives() throws IOException {
        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

    @Test
    public void testGetPrimitivesChunks() throws IOException {
        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();
View Full Code Here

Examples of java.io.DataOutputStream.writeShort()

        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        DataOutputStream o1 = new DataOutputStream(bo);
        LinkedBufferOutput o2 = new LinkedBufferOutput(10);
        o1.writeByte((byte)2);
        o2.writeByte((byte)2);
        o1.writeShort((short)2);
        o2.writeShort((short)2);
        o1.writeInt(2);
        o2.writeInt(2);
        o1.writeLong(2L);
        o2.writeLong(2L);
View Full Code Here

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

Examples of java.io.DataOutputStream.writeShort()

                        }

                        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
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.