Package com.google.common.io

Examples of com.google.common.io.LittleEndianDataInputStream


    @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
    public InputStreamSliceInput(InputStream inputStream)
    {
        pushbackInputStream = new PushbackInputStream(inputStream);
        countingInputStream = new CountingInputStream(pushbackInputStream);
        dataInputStream = new LittleEndianDataInputStream(countingInputStream);
    }
View Full Code Here


        DataPoint completeDataPoints[] = new DataPoint[numOfDataPoints];

        // Because Intel CPU is using little endian natively, we
        // need to use LittleEndianDataInputStream instead of normal
        // Java DataInputStream, which is big-endian.
        LittleEndianDataInputStream dis = new LittleEndianDataInputStream(
            dumpStream);
        for (int i = 0; i < numOfDataPoints; i++) {
          double mz = dis.readDouble();
          double intensity = dis.readDouble();
          completeDataPoints[i] = new SimpleDataPoint(mz, intensity);
        }

        boolean centroided = ScanUtils.isCentroided(completeDataPoints);
View Full Code Here

        final LittleEndianDataOutputStream writer = new LittleEndianDataOutputStream(new FileOutputStream("src/test/resources/test_le.txt"));
        writer.writeInt(value);
        writer.close();

        final LittleEndianDataInputStream reader = new LittleEndianDataInputStream(new DataInputStream(new FileInputStream("src/test/resources/test_le.txt")));
        final int result = reader.readInt();
        reader.close();

        assertEquals(value, result);
    }
View Full Code Here

    DataInput br = null;
    try
    {
      // open a stream to the file
      BufferedInputStream bis = new BufferedInputStream(source, 8192);
      br = new LittleEndianDataInputStream(bis);
//      br.setByteOrder(ByteOrder.LITTLE_ENDIAN);

      TgaHeader header = new TgaHeader();
      header.Read(br);
View Full Code Here

      }


  public static ImageSize GetTGASize(String filename) throws IOException
  {
    DataInput br = new LittleEndianDataInputStream(new FileInputStream(new File(filename)));

    TgaHeader header = new TgaHeader();
    header.Read(br);
//    br.close();
    return new ImageSize(header.ImageSpec.Width, header.ImageSpec.Height);
View Full Code Here

TOP

Related Classes of com.google.common.io.LittleEndianDataInputStream

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.