DataInput di = dis; if (isLittleEndian) { di = new LittleEndianDataInput(dis);
DataInput di = dis; if (isLittleEndian) { di = new LittleEndianDataInput(dis);
@Before public void setup() throws Exception { in = new MockInputStream(); array = new byte[10]; littleEndien = new LittleEndianDataInput(in); }
public Image load(final InputStream is, final boolean flipVertically) throws IOException { final LittleEndianDataInput in = new LittleEndianDataInput(is); // Read and check magic word... final int dwMagic = in.readInt(); if (dwMagic != getInt("DDS ")) { throw new Error("Not a dds file."); } logger.finest("Reading DDS file."); // Create our data store; final DdsImageInfo info = new DdsImageInfo(); info.flipVertically = flipVertically; // Read standard dds header info.header = DdsHeader.read(in); // if applicable, read DX10 header info.headerDX10 = info.header.ddpf.dwFourCC == getInt("DX10") ? DdsHeaderDX10.read(in) : null; // Create our new image final Image image = new Image(); image.setWidth(info.header.dwWidth); image.setHeight(info.header.dwHeight); // update depth based on flags / header updateDepth(image, info); // add our format and image data. populateImage(image, info, in); // return the loaded image return image; }
public Image load(final InputStream is, final boolean flipVertically) throws IOException { final LittleEndianDataInput in = new LittleEndianDataInput(is); // Read and check magic word... final int dwMagic = in.readInt(); if (dwMagic != getInt("DDS ")) { throw new Error("Not a dds file."); } logger.finest("Reading DDS file."); // Create our data store; final DdsImageInfo info = new DdsImageInfo(); info.flipVertically = flipVertically; // Read standard dds header info.header = DdsHeader.read(in); // if applicable, read DX10 header info.headerDX10 = info.header.ddpf.dwFourCC == getInt("DX10") ? DdsHeaderDX10.read(in) : null; // Create our new image final Image image = new Image(); image.setWidth(info.header.dwWidth); image.setHeight(info.header.dwHeight); // update depth based on flags / header updateDepth(image, info); // add our format and image data. populateImage(image, info, in); // return the loaded image return image; }