Package java.io

Examples of java.io.DataOutputStream.writeShort()


          int units = dis.readUnsignedByte();
          if(units > 2)
            throwError("Invalid header", "Unrecognized units type "+units+".");
          dos.write(units);
          dos.writeShort(dis.readShort()); // Copy Xdensity
          dos.writeShort(dis.readShort()); // Copy Ydensity
          int thumbX = dis.readUnsignedByte();
          dos.writeByte(thumbX);
          int thumbY = dis.readUnsignedByte();
          dos.writeByte(thumbY);
          int thumbLen = thumbX * thumbY * 3;
 
View Full Code Here


        frame = new byte[frameLength-4];
        in.readFully(frame);
        out.writeInt(frameHeader);
        // FIXME CRCs may or may not work. I have not been able to find an mp3 file with CRCs but without free bitrate.
        if(hasCRC)
          out.writeShort(crc);
        out.write(frame);
        totalFrames++;
        foundFrames++;
        if(countLostSyncBytes != 0)
          Logger.normal(this, "Lost sync for "+countLostSyncBytes+" bytes");
View Full Code Here

            {
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
                DataOutputStream dout = new DataOutputStream(bout);
                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                byte[] buffer = addr.getAddress();
                for (int i = 0; i < buffer.length; i++)
                {
                    dout.writeByte(buffer[i]);
View Full Code Here

            try
            {
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
                DataOutputStream dout = new DataOutputStream(bout);
                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                dout.writeShort(priority);
                dout.writeShort(weight);
                dout.writeShort(port);
View Full Code Here

            {
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
                DataOutputStream dout = new DataOutputStream(bout);
                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                dout.writeShort(priority);
                dout.writeShort(weight);
                dout.writeShort(port);
                dout.write(server.getBytes("UTF8"));
View Full Code Here

                DataOutputStream dout = new DataOutputStream(bout);
                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                dout.writeShort(priority);
                dout.writeShort(weight);
                dout.writeShort(port);
                dout.write(server.getBytes("UTF8"));
                dout.close();
                return bout.toByteArray();
View Full Code Here

                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                dout.writeShort(priority);
                dout.writeShort(weight);
                dout.writeShort(port);
                dout.write(server.getBytes("UTF8"));
                dout.close();
                return bout.toByteArray();
            }
View Full Code Here

                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                dout.writeShort(priority);
                dout.writeShort(weight);
                dout.writeShort(port);
                dout.write(server.getBytes("UTF8"));
                dout.close();
                return bout.toByteArray();
            }
            catch (IOException e)
View Full Code Here

            try
            {
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
                DataOutputStream dout = new DataOutputStream(bout);
                dout.write(name.getBytes("UTF8"));
                dout.writeShort(type);
                dout.writeShort(clazz);
                //dout.writeInt(len);
                byte[] buffer = addr.getAddress();
                for (int i = 0; i < buffer.length; i++)
                {
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.