Class Utility

java.lang.Object
edu.sc.seis.seisFile.mseed.Utility

public class Utility extends Object
Utility.java Created: Fri Apr 2 14:28:55 1999
  • Constructor Details

    • Utility

      public Utility()
  • Method Details

    • extractInteger

      public static int extractInteger(byte[] info, int start, int length)
    • extractString

      public static String extractString(byte[] info, int start, int length)
    • extractVarString

      public static String extractVarString(byte[] info, int start, int maxLength)
    • extractNullTermString

      public static String extractNullTermString(byte[] info, int start, int maxLength)
    • writeNullTermString

      public static void writeNullTermString(String value, int maxLength, DataOutput out) throws IOException
      Throws:
      IOException
    • bytesToShort

      public static short bytesToShort(byte hi, byte low, boolean swapBytes)
    • bytesToInt

      public static int bytesToInt(byte a)
    • uBytesToInt

      public static int uBytesToInt(byte a)
    • bytesToInt

      public static int bytesToInt(byte[] info, int start, boolean swapBytes)
    • bytesToLong

      public static long bytesToLong(byte[] info, int start, boolean swapBytes)
    • bytesToInt

      public static int bytesToInt(byte a, byte b, boolean swapBytes)
    • uBytesToInt

      public static int uBytesToInt(byte a, byte b, boolean swapBytes)
    • bytesToInt

      public static int bytesToInt(byte a, byte b, byte c, boolean swapBytes)
    • bytesToInt

      public static int bytesToInt(byte a, byte b, byte c, byte d, boolean swapBytes)
    • bytesToLong

      public static long bytesToLong(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes)
    • bytesToFloat

      public static float bytesToFloat(byte a, byte b, byte c, byte d, boolean swapBytes)
    • bytesToDouble

      public static double bytesToDouble(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes)
    • bytesToDouble

      public static double bytesToDouble(byte[] info, int start, boolean swapBytes)
    • bytesToFloat

      public static float bytesToFloat(byte[] info, int start, boolean swapBytes)
    • shortToByteArray

      public static byte[] shortToByteArray(int a)
    • intToByteArray

      public static byte[] intToByteArray(int a)
    • floatToByteArray

      public static byte[] floatToByteArray(float a)
    • longToByteArray

      public static byte[] longToByteArray(long a)
    • doubleToByteArray

      public static byte[] doubleToByteArray(double d)
    • shortToLittleEndianByteArray

      public static byte[] shortToLittleEndianByteArray(int a)
    • intToLittleEndianByteArray

      public static byte[] intToLittleEndianByteArray(int a)
    • floatToLittleEndianByteArray

      public static byte[] floatToLittleEndianByteArray(float a)
    • longToLittleEndianByteArray

      public static byte[] longToLittleEndianByteArray(long a)
    • doubleToLittleEndianByteArray

      public static byte[] doubleToLittleEndianByteArray(double d)
    • insertFloat

      public static void insertFloat(float value, byte[] dest, int pos)
      Inserts float into dest at index pos
    • pad

      public static byte[] pad(byte[] source, int requiredBytes, byte paddingByte)
    • format

      public static byte[] format(byte[] source, int start, int end)
    • areContiguous

      public static boolean areContiguous(DataRecord first, DataRecord second)
    • breakContiguous

      public static List<List<DataRecord>> breakContiguous(List<DataRecord> inList)
      breaks the List into sublists where the DataRecords are contiguous. Assumes that the input List is sorted (by begin time?) and does not contain overlaps.
    • cleanDuplicatesOverlaps

      public static void cleanDuplicatesOverlaps(List<DataRecord> drFromFileList)