本文整理汇总了Java中com.google.common.io.LittleEndianDataInputStream.readShort方法的典型用法代码示例。如果您正苦于以下问题:Java LittleEndianDataInputStream.readShort方法的具体用法?Java LittleEndianDataInputStream.readShort怎么用?Java LittleEndianDataInputStream.readShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.io.LittleEndianDataInputStream
的用法示例。
在下文中一共展示了LittleEndianDataInputStream.readShort方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: skipTimeIndependentData
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
* @param dataStream
* @throws IOException
*/
private void skipTimeIndependentData(LittleEndianDataInputStream dataStream)
throws IOException {
header = BinaryHeaderDAO.readData(dataStream);
// System.out.println(header.getModelAndVersion());
// System.out.println("Fileversion: " + header.getFileversion());
ComponentData compData = ComponentDataDAO.readData(dataStream,
header.getFileversion());
SpecieDataDAO.readData(dataStream);
dataStream.skip(24); // other stuff
releaseSiteData = ReleaseSiteDataDAO.readData(dataStream);
ReleaseDataDAO.readData(dataStream, releaseSiteData.getNumberSites(),
compData.getTotalNumberOfComponents());
expandingGrid = (dataStream.readShort() == 1);
dataStream.skip(6); // more other stuff
ResponseDataDAO.readData(dataStream);
}
示例2: readData
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
* Create releaseSite from data read from dataStream
*
* @param dataStream
* @throws IOException
*/
public static ReleaseSite readData(
LittleEndianDataInputStream dataStream) throws IOException {
ReleaseSite data = new ReleaseSite();
data.longitude = dataStream.readDouble();
data.latitude = dataStream.readDouble();
data.depth = dataStream.readDouble();
data.bathymetry = dataStream.readDouble();
data.releaseDiameter = dataStream.readDouble();
data.startTime = dataStream.readDouble();
data.duration = dataStream.readDouble();
data.moving = dataStream.readShort();
return data;
}
示例3: readData
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
* Read SpecieData from dataStream
*
* @param dataStream
* @throws IOException
*/
public static SpecieData readData(LittleEndianDataInputStream dataStream)
throws IOException {
SpecieData data = new SpecieData();
short numberSpecies = dataStream.readShort();
if (numberSpecies > 0) {
Vector<Specie> species = new Vector<Specie>();
for (int i = 0; i < numberSpecies; i++) {
species.add(SpecieDAO.readData(dataStream));
}
data.species = species;
}
return data;
}
示例4: getInt
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
private static int getInt(LittleEndianDataInputStream ledis) throws IOException {
short fieldLength = ledis.readShort();
if (fieldLength != 4) {
throw new IllegalStateException("Int required but length was " + fieldLength);
}
return ledis.readInt();
}
示例5: getLong
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
private static long getLong(LittleEndianDataInputStream ledis) throws IOException {
short fieldLength = ledis.readShort();
if (fieldLength != 8) {
throw new IllegalStateException("Long required but length was " + fieldLength);
}
return ledis.readLong();
}
示例6: readData
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
* Read ReleaseSiteData from dataStream
*
* @param dataStream
* @throws IOException
*/
public static ReleaseSiteData readData(
LittleEndianDataInputStream dataStream) throws IOException {
ReleaseSiteData data = new ReleaseSiteData();
int numberReleaseSites = dataStream.readShort();
if (numberReleaseSites > 0) {
Vector<ReleaseSite> sites = new Vector<ReleaseSite>();
for (int i = 0; i < numberReleaseSites; i++) {
sites.add(ReleaseSiteDAO.readData(dataStream));
}
data.sites = sites;
}
return data;
}
示例7: readData
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
* Create Specie with data from dataStream
* @param dataStream
* @throws IOException
*/
public static Specie readData(LittleEndianDataInputStream dataStream) throws IOException {
int lengthOfSpecieName = dataStream.readShort();
Specie data = new Specie();
data.name = getString(dataStream, lengthOfSpecieName);
int numberOfStages = dataStream.readShort();
for (int j = 0; j < numberOfStages; j++) {
String stageName = getString(dataStream, dataStream.readShort());
data.stages.add(stageName);
}
return data;
}
示例8: Release
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
/**
*
* @param dataStream
* @param numberComponentsInProfile
* @throws IOException
*/
public Release(LittleEndianDataInputStream dataStream, int numberComponentsInProfile) throws IOException {
short lengthOfProfileName;
lengthOfProfileName = dataStream.readShort();
this.profile = getString(dataStream, lengthOfProfileName);
this.releaseRate = dataStream.readFloat();
this.componentConcentrations = new Vector<Float>();
for (int i = 0; i < numberComponentsInProfile; i++) {
this.componentConcentrations.add(Float.valueOf(dataStream.readFloat()));
}
}
示例9: getByteArray
import com.google.common.io.LittleEndianDataInputStream; //导入方法依赖的package包/类
private static byte [] getByteArray(LittleEndianDataInputStream ledis) throws IOException {
short fieldLength = ledis.readShort();
byte [] value = new byte[fieldLength];
ledis.readFully(value);
return value;
}