Package java.io

Examples of java.io.DataOutputStream


            RecordStore rs = RecordStore.openRecordStore(this.szRsSettings, true);
            byte[] bSource = this.szCurrentSource.getBytes();
            setRecord(rs, this.nIdSource, bSource);
            bSource = null;
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(baos);
            dos.flush();
            baos.flush();
            byte[] bRes = baos.toByteArray();
            dos = null;
            baos = null;
            setRecord(rs, this.nIdSettings, bRes);
View Full Code Here


   
            remoteFile = initPut(remoteFile, append);
   
            // get an output stream
            out = new BufferedOutputStream(
                    new DataOutputStream(getOutputStream()), transferBufferSize*2);
           
            // if resuming, we skip over the unwanted bytes
            if (resume && resumeMarker > 0) {
                in.skip(resumeMarker);
            }
View Full Code Here

        probe("asasdfdfagfffffaerawefgsgsdffffgvsdfgsgfsgfgweffvsregsrevsdfsagghhawdfd".getBytes());
    }

    public void testRand1000() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(22222);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 1000; i++) {
                data.writeInt(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

        }
    }

    public void testRand10000() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(44444);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 10000; i++) {
                data.writeInt(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

        }
    }

    public void testRandGaussian10000() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(3333);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 10000; i++) {
                data.writeDouble(rand.nextGaussian());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

        probe("asasdfdfagfffffaerawefgsgsdffffgvsdfgsgfsgfgweffvsregsrevsdfsagghhawdfd".getBytes());
    }

    public void testRand1000() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(22222);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 1000; i++) {
                data.writeInt(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

        }
    }

    public void testRandChars2000() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(22222);
        for(int times = 0; times < 10; times++) {
            for(int i = 0; i < 2048; i++) {
                data.writeChar(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

        }
    }

    public void testRandChars8K() throws IOException {
        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(22222);
        for(int times = 0; times < 10; times++) {
            for(int i = 0; i < 4096; i++) {
                data.writeChar(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

    if (isSupportedType(transferData)) {
      URLType[] myTypes = (URLType[]) object;
      try {
        // write data to a byte array and then ask super to convert to pMedium
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream writeOut = new DataOutputStream(out);
        for (int i = 0, length = myTypes.length; i < length; i++) {
          writeOut.writeBytes(myTypes[i].linkURL);
          writeOut.writeBytes("\n");
          writeOut.writeBytes(myTypes[i].linkText);
        }
        byte[] buffer = out.toByteArray();
        writeOut.close();

        super.javaToNative(buffer, transferData);

      } catch (IOException e) {
      }
View Full Code Here

        int n = input.length;
        int bitwidth = estimateAdequateBitWidth(input, n);
        CompressedSegment segment = new CompressedSegment(bitwidth);
        compress(input, n, segment);
        FastByteArrayOutputStream bos = new FastByteArrayOutputStream(4096);
        DataOutputStream dos = new DataOutputStream(bos);
        try {
            segment.writeTo(dos);
            dos.flush();
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
        byte[] b = bos.toByteArray();
        return b;
View Full Code Here

TOP

Related Classes of java.io.DataOutputStream

Copyright © 2018 www.massapicom. 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.