Package java.io

Examples of java.io.DataOutputStream.writeInt()


                if(v == prevKey) {
                    os.writeInt(-1);
                } else {
                    final int len = v.getLength();
                    final int size = len - prefixlen;
                    os.writeInt(size);
                    if(size > 0) {
                        v.writeTo(os, prefixlen, size);
                    }
                }
                prevKey = v;
View Full Code Here


      while (iterA.hasNext())
        outStream.writeLong(iterA.getLongNext());

    } else if (classType == int.class) {
      while (iterA.hasNext())
        outStream.writeInt(iterA.getIntNext());

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

      while (iterA.hasNext())
        outStream.writeLong(iterA.getLongNext());

    } else if (classType == int.class) {
      while (iterA.hasNext())
        outStream.writeInt(iterA.getIntNext());

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

        DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
       
        while(true) {
          int num = dis.readInt();
         
          dos.writeInt(num + 1);
        }
       
       
      } catch (IOException e) {
        // TODO Auto-generated catch block
View Full Code Here

                bufferOut.writeLong(delay);
                bufferOut.write(b,0,b.length);
            }

            //  Write out the file header
            fileOut.writeInt(maxw);
            fileOut.writeInt(maxh);
            fileOut.writeLong((long)(delay * args.length));

            //  Write out the file itself
            fileOut.write( bout.toByteArray() );
View Full Code Here

                bufferOut.write(b,0,b.length);
            }

            //  Write out the file header
            fileOut.writeInt(maxw);
            fileOut.writeInt(maxh);
            fileOut.writeLong((long)(delay * args.length));

            //  Write out the file itself
            fileOut.write( bout.toByteArray() );

View Full Code Here

            FileOutputStream fout= new FileOutputStream( path);
      BufferedOutputStream bout= new BufferedOutputStream( fout);
      DataOutputStream dout= new DataOutputStream( bout);

      dout.writeInt( targets.size());

      for( int i= 0; i < targets.size(); i++) {
          Target target= (Target) targets.elementAt( i);

    writeString( dout, target.localPort);
View Full Code Here

      BufferedOutputStream bout= new BufferedOutputStream( fout);
      DataOutputStream dout= new DataOutputStream( bout);

      writeString( dout, local_data_port);

      dout.writeInt( targets.size());

      for( int i= 0; i < targets.size(); i++) {
          Target target= (Target) targets.elementAt( i);

    writeString( dout, target.ip);
View Full Code Here

    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

    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

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.