Package edu.sc.seis.seisFile.mseed
Class Utility
- java.lang.Object
-
- edu.sc.seis.seisFile.mseed.Utility
-
public class Utility extends java.lang.ObjectUtility.java Created: Fri Apr 2 14:28:55 1999
-
-
Constructor Summary
Constructors Constructor Description Utility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareContiguous(DataRecord first, DataRecord second)static java.util.List<java.util.List<DataRecord>>breakContiguous(java.util.List<DataRecord> inList)breaks the List into sublists where the DataRecords are contiguous.static doublebytesToDouble(byte[] info, int start, boolean swapBytes)static doublebytesToDouble(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes)static floatbytesToFloat(byte[] info, int start, boolean swapBytes)static floatbytesToFloat(byte a, byte b, byte c, byte d, boolean swapBytes)static intbytesToInt(byte a)static intbytesToInt(byte[] info, int start, boolean swapBytes)static intbytesToInt(byte a, byte b, boolean swapBytes)static intbytesToInt(byte a, byte b, byte c, boolean swapBytes)static intbytesToInt(byte a, byte b, byte c, byte d, boolean swapBytes)static longbytesToLong(byte[] info, int start, boolean swapBytes)static longbytesToLong(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes)static shortbytesToShort(byte hi, byte low, boolean swapBytes)static voidcleanDuplicatesOverlaps(java.util.List<DataRecord> drFromFileList)static byte[]doubleToByteArray(double d)static intextractInteger(byte[] info, int start, int length)static java.lang.StringextractNullTermString(byte[] info, int start, int maxLength)static java.lang.StringextractString(byte[] info, int start, int length)static java.lang.StringextractVarString(byte[] info, int start, int maxLength)static byte[]floatToByteArray(float a)static byte[]format(byte[] source, int start, int end)static voidinsertFloat(float value, byte[] dest, int pos)Inserts float into dest at index posstatic byte[]intToByteArray(int a)static byte[]longToByteArray(long a)static voidmain(java.lang.String[] args)static byte[]pad(byte[] source, int requiredBytes, byte paddingByte)static intuBytesToInt(byte a)static intuBytesToInt(byte a, byte b, boolean swapBytes)static voidwriteNullTermString(java.lang.String value, int maxLength, java.io.DataOutput out)
-
-
-
Method Detail
-
extractInteger
public static int extractInteger(byte[] info, int start, int length)
-
extractString
public static java.lang.String extractString(byte[] info, int start, int length)
-
extractVarString
public static java.lang.String extractVarString(byte[] info, int start, int maxLength)
-
extractNullTermString
public static java.lang.String extractNullTermString(byte[] info, int start, int maxLength)
-
writeNullTermString
public static void writeNullTermString(java.lang.String value, int maxLength, java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.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)
-
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)
-
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 java.util.List<java.util.List<DataRecord>> breakContiguous(java.util.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.
-
main
public static void main(java.lang.String[] args)
-
cleanDuplicatesOverlaps
public static void cleanDuplicatesOverlaps(java.util.List<DataRecord> drFromFileList)
-
-