Examples of writeBytes()


Examples of org.jgroups.util.ByteArrayDataOutputStream.writeBytes()


    public void testWriteBytes() {
        String name="Bela";
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(2);
        out.writeBytes(name);
        assert out.position() == name.length();
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        byte[] tmp=new byte[name.length()];
        int read=in.read(tmp, 0, tmp.length);
        assert read == name.length();
View Full Code Here

Examples of org.lealone.value.Transfer.writeBytes()

        trans.writeInt(Constants.TCP_PROTOCOL_VERSION_6);
        trans.writeInt(Constants.TCP_PROTOCOL_VERSION_12);
        trans.writeString(db);
        trans.writeString(ci.getURL());
        trans.writeString(ci.getUserName());
        trans.writeBytes(ci.getUserPasswordHash());
        trans.writeBytes(ci.getFilePasswordHash());
        String[] keys = ci.getKeys();
        trans.writeInt(keys.length);
        for (String key : keys) {
            trans.writeString(key).writeString(ci.getProperty(key));
View Full Code Here

Examples of org.lilyproject.bytes.api.DataOutput.writeBytes()

        boolean b = random.nextBoolean();
        dataOutput.writeBoolean(b);
        byte[] bytes = new byte[10];
        random.nextBytes(bytes);
        dataOutput.writeByte(bytes[0]);
        dataOutput.writeBytes(bytes);
        double d = random.nextDouble();
        dataOutput.writeDouble(d);
        float f = random.nextFloat();
        dataOutput.writeFloat(f);
        int i = random.nextInt();
View Full Code Here

Examples of org.lilyproject.bytes.impl.DataOutputImpl.writeBytes()

        boolean b = random.nextBoolean();
        dataOutput.writeBoolean(b);
        byte[] bytes = new byte[10];
        random.nextBytes(bytes);
        dataOutput.writeByte(bytes[0]);
        dataOutput.writeBytes(bytes);
        double d = random.nextDouble();
        dataOutput.writeDouble(d);
        float f = random.nextFloat();
        dataOutput.writeFloat(f);
        int i = random.nextInt();
View Full Code Here

Examples of org.netbeans.lib.cvsclient.util.LoggedDataOutputStream.writeBytes()

            BufferedInputStream bis =
                    new BufferedInputStream(socket.getInputStream(), 32768);
            LoggedDataInputStream inputStream = new LoggedDataInputStream(bis);
            setInputStream(inputStream);
     
            outputStream.writeBytes(preamble, "US-ASCII");
            outputStream.writeBytes(getRepository() + "\n"); //NOI18N
            outputStream.writeBytes(userName + "\n"); //NOI18N
            outputStream.writeBytes(getEncodedPasswordNotNull() + "\n", "US-ASCII"); //NOI18N
            outputStream.writeBytes(postamble, "US-ASCII");
            outputStream.flush();
View Full Code Here

Examples of org.xmlBlaster.jms.XBBytesMessage.writeBytes()

            content = new byte[256];
            for (int i=0; i < 256; i++) {
               content[i] = (byte)i;
            }
           
            msg.writeBytes(content, 0, content.length);
            XBDestination dest = new XBDestination("someTopic", null);
            msg.setJMSDestination(dest);
            msg.reset();
           
            byte[] content2 = new byte[256];
View Full Code Here

Examples of parquet.column.values.plain.PlainValuesWriter.writeBytes()

        PlainValuesWriter dictionaryEncoder = new PlainValuesWriter(lastUsedDictionaryByteSize);
        Iterator<Binary> binaryIterator = binaryDictionaryContent.keySet().iterator();
        // write only the part of the dict that we used
        for (int i = 0; i < lastUsedDictionarySize; i++) {
          Binary entry = binaryIterator.next();
          dictionaryEncoder.writeBytes(entry);
        }
        return new DictionaryPage(dictionaryEncoder.getBytes(), lastUsedDictionarySize, PLAIN_DICTIONARY);
      }
      return plainValuesWriter.createDictionaryPage();
    }
View Full Code Here

Examples of promauto.utils.RpSerialPort.writeBytes()

      // Command - write and read hex
      if (cmd[1].equals("hex") || cmd[1].equals("h")) {
        RpSerialPort port = getPortForConsoleCommand(cmd);
        byte[] bout = RpHyperstring.hexStringToBytes(cmd, 3);
        svcConsole.write(JRoboStrings.SVCSERIAL_WRITE_TO + port.getName()+": "+ RpHyperstring.bytesToHexString(bout) +"\n" );
        port.writeBytes(bout);
        byte[] bin = new byte[2048];
        int n = port.readBytes(bin);
        byte[] bb = Arrays.copyOfRange(bin, 0, Math.abs(n));
        svcConsole.write(JRoboStrings.SVCSERIAL_READ_FROM + port.getName()+": "+ RpHyperstring.bytesToHexString(bb) +"\n" );
      } else
View Full Code Here

Examples of streamer.ByteBuffer.writeBytes()

        {
            int length = 1024; // Large enough
            ByteBuffer buf = new ByteBuffer(length, true);

            /* @formatter:off */
            buf.writeBytes(new byte[] {
                    // MCS Send Data Request
                    (byte)0x64,
                    // Initiator: 1004 (1001+3)
                    (byte)0x00, (byte)0x03,
                    // Channel ID: 1003 (I/O channel)
View Full Code Here

Examples of uk.ac.ucl.panda.utility.io.IndexOutput.writeBytes()

          long len = is.length();
          long readCount = 0;
          while (readCount < len) {
            int toRead = readCount + BufferedIndexOutput.getBufSize() > len ? (int)(len - readCount) : BufferedIndexOutput.getBufSize();
            is.readBytes(buf, 0, toRead);
            os.writeBytes(buf, toRead);
            readCount += toRead;
          }
        } finally {
          // graceful cleanup
          try {
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.