Package edu.sc.seis.seisFile.mseed
Class Utility
java.lang.Object
edu.sc.seis.seisFile.mseed.Utility
Utility.java
Created: Fri Apr 2 14:28:55 1999
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areContiguous
(DataRecord first, DataRecord second) static List<List<DataRecord>>
breakContiguous
(List<DataRecord> inList) breaks the List into sublists where the DataRecords are contiguous.static double
bytesToDouble
(byte[] info, int start, boolean swapBytes) static double
bytesToDouble
(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes) static float
bytesToFloat
(byte[] info, int start, boolean swapBytes) static float
bytesToFloat
(byte a, byte b, byte c, byte d, boolean swapBytes) static int
bytesToInt
(byte a) static int
bytesToInt
(byte[] info, int start, boolean swapBytes) static int
bytesToInt
(byte a, byte b, boolean swapBytes) static int
bytesToInt
(byte a, byte b, byte c, boolean swapBytes) static int
bytesToInt
(byte a, byte b, byte c, byte d, boolean swapBytes) static long
bytesToLong
(byte[] info, int start, boolean swapBytes) static long
bytesToLong
(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes) static short
bytesToShort
(byte hi, byte low, boolean swapBytes) static void
cleanDuplicatesOverlaps
(List<DataRecord> drFromFileList) static byte[]
doubleToByteArray
(double d) static byte[]
doubleToLittleEndianByteArray
(double d) static int
extractInteger
(byte[] info, int start, int length) static String
extractNullTermString
(byte[] info, int start, int maxLength) static String
extractString
(byte[] info, int start, int length) static String
extractVarString
(byte[] info, int start, int maxLength) static byte[]
floatToByteArray
(float a) static byte[]
floatToLittleEndianByteArray
(float a) static byte[]
format
(byte[] source, int start, int end) static void
insertFloat
(float value, byte[] dest, int pos) Inserts float into dest at index posstatic byte[]
intToByteArray
(int a) static byte[]
intToLittleEndianByteArray
(int a) static byte[]
longToByteArray
(long a) static byte[]
longToLittleEndianByteArray
(long a) static byte[]
pad
(byte[] source, int requiredBytes, byte paddingByte) static byte[]
shortToByteArray
(int a) static byte[]
shortToLittleEndianByteArray
(int a) static int
uBytesToInt
(byte a) static int
uBytesToInt
(byte a, byte b, boolean swapBytes) static void
writeNullTermString
(String value, int maxLength, DataOutput out)
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
extractInteger
public static int extractInteger(byte[] info, int start, int length) -
extractString
-
extractVarString
-
extractNullTermString
-
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
-
breakContiguous
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
-