Examples of writeDouble()


Examples of java.io.DataOutputStream.writeDouble()

        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();

        LinkedBufferInput b = new LinkedBufferInput(1024);

        for(int i=0; i < 2; i++) {
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

        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();

        LinkedBufferInput b = new LinkedBufferInput(1024);

        for(int i=0; i < 2; i++) {
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

        o2.writeInt(2);
        o1.writeLong(2L);
        o2.writeLong(2L);
        o1.writeFloat(1.1f);
        o2.writeFloat(1.1f);
        o1.writeDouble(1.1);
        o2.writeDouble(1.1);
        byte[] b1 = bo.toByteArray();
        byte[] b2 = o2.toByteArray();
        assertEquals(b1.length, b2.length);
        assertArrayEquals(b1, b2);
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

        o2.writeByteAndLong((byte)9, 2L);
        o1.writeByte((byte)9);
        o1.writeFloat(1.1f);
        o2.writeByteAndFloat((byte)9, 1.1f);
        o1.writeByte((byte)9);
        o1.writeDouble(1.1);
        o2.writeByteAndDouble((byte)9, 1.1);
        byte[] b1 = bo.toByteArray();
        byte[] b2 = o2.toByteArray();
        assertEquals(b1.length, b2.length);
        assertArrayEquals(b1, b2);
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

                Vector timeSlice =
                    sspace.getVectorBetween(word, timestep, timestep + 1);
                if (timeSlice != null) {
                    dos.writeLong(timestep);
                    for (int i = 0; i < timeSlice.length(); ++i) {
                        dos.writeDouble(timeSlice.getValue(i).doubleValue());
                    }
                }
            }
        }
        dos.close();
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

                    dos.writeInt(nonZero);
                    for (int i = 0; i < timeSlice.length(); ++i) {
                        double d = timeSlice.getValue(i).doubleValue();
                        if (d != 0d) {
                            dos.writeInt(i);
                            dos.writeDouble(d);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

        for (String word : words) {
            dos.writeUTF(word);
        Vector v = sspace.getVector(word);
        for (int i = 0; i < v.length(); ++i) {
            dos.writeDouble(v.getValue(i).doubleValue());
            }
        }
        dos.close();
    }
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

                    SparseDoubleVector sdv = (SparseDoubleVector)vector;
                    int[] nz = sdv.getNonZeroIndices();
                    dos.writeInt(nz.length);
                    for (int i : nz) {
                        dos.writeInt(i);
                        dos.writeDouble(sdv.get(i));
                    }
                }
                else {
                    SparseVector sv = (SparseVector)vector;
                    int[] nz = sv.getNonZeroIndices();
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

                    SparseVector sv = (SparseVector)vector;
                    int[] nz = sv.getNonZeroIndices();
                    dos.writeInt(nz.length);
                    for (int i : nz) {
                        dos.writeInt(i);
                        dos.writeDouble(sv.getValue(i).doubleValue());
                    }
                }
            }
            else {
                // count how many are non-zero
View Full Code Here

Examples of java.io.DataOutputStream.writeDouble()

                dos.writeInt(nonZero);
                for (int i = 0; i < vector.length(); ++i) {
                    double d = vector.getValue(i).doubleValue();
                    if (d != 0d) {
                        dos.writeInt(i);
                        dos.writeDouble(d);
                    }
                }
            }
        }
        dos.close();
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.