private void writeInt(int intValue, OutStream os) throws IOException { ByteOrderValues.putInt(intValue, buf, byteOrder); os.write(buf, 4); }
private void writeCoordinate(CoordinateSequence seq, int index, OutStream os) throws IOException { ByteOrderValues.putDouble(seq.getX(index), buf, byteOrder); os.write(buf, 8); ByteOrderValues.putDouble(seq.getY(index), buf, byteOrder); os.write(buf, 8); // only write 3rd dim if caller has requested it for this writer if (outputDimension >= 3) { // if 3rd dim is requested, only write it if the CoordinateSequence provides it double ordVal = Coordinate.NULL_ORDINATE; if (seq.getDimension() >= 3) ordVal = seq.getOrdinate(index, 2); ByteOrderValues.putDouble(ordVal, buf, byteOrder); os.write(buf, 8); } } }
public double readDouble() throws IOException { stream.read(buf8); return ByteOrderValues.getDouble(buf8, byteOrder); }
public static double getDouble(byte[] buf, int byteOrder) { long longVal = getLong(buf, byteOrder); return Double.longBitsToDouble(longVal); }
public static void putDouble(double doubleValue, byte[] buf, int byteOrder) { long longVal = Double.doubleToLongBits(doubleValue); putLong(longVal, buf, byteOrder); }
public int readInt() throws IOException { stream.read(buf4); return ByteOrderValues.getInt(buf4, byteOrder); } public long readLong()
public long readLong() throws IOException { stream.read(buf8); return ByteOrderValues.getLong(buf8, byteOrder); }
public static void putDouble(double doubleValue, byte[] buf, int byteOrder) { long longVal = Double.doubleToLongBits(doubleValue); putLong(longVal, buf, byteOrder); }
public int readInt() throws IOException { stream.read(buf4); return ByteOrderValues.getInt(buf4, byteOrder); } public long readLong()
private void writeInt(int intValue, OutStream os) throws IOException { ByteOrderValues.putInt(intValue, buf, byteOrder); os.write(buf, 4); }
private void writeCoordinate(CoordinateSequence seq, int index, OutStream os) throws IOException { ByteOrderValues.putDouble(seq.getX(index), buf, byteOrder); os.write(buf, 8); ByteOrderValues.putDouble(seq.getY(index), buf, byteOrder); os.write(buf, 8); // only write 3rd dim if caller has requested it for this writer if (outputDimension >= 3) { // if 3rd dim is requested, only access and write it if the CS provides is double ordVal = Coordinate.NULL_ORDINATE; if (seq.getDimension() >= 3) ordVal = seq.getOrdinate(index, 2); ByteOrderValues.putDouble(ordVal, buf, byteOrder); os.write(buf, 8); } }
public static double getDouble(byte[] buf, int byteOrder) { long longVal = getLong(buf, byteOrder); return Double.longBitsToDouble(longVal); }
public double readDouble() throws IOException { stream.read(buf8); return ByteOrderValues.getDouble(buf8, byteOrder); }
private void writeInt(int intValue, OutStream os) throws IOException { ByteOrderValues.putInt(intValue, buf, byteOrder); os.write(buf, 4); }
private void writeCoordinate(CoordinateSequence seq, int index, OutStream os) throws IOException { ByteOrderValues.putDouble(seq.getX(index), buf, byteOrder); os.write(buf, 8); ByteOrderValues.putDouble(seq.getY(index), buf, byteOrder); os.write(buf, 8); // only write 3rd dim if caller has requested it for this writer if (outputDimension >= 3) { // if 3rd dim is requested, only write it if the CoordinateSequence provides it double ordVal = Coordinate.NULL_ORDINATE; if (seq.getDimension() >= 3) ordVal = seq.getOrdinate(index, 2); ByteOrderValues.putDouble(ordVal, buf, byteOrder); os.write(buf, 8); } } }
public long readLong() throws IOException { stream.read(buf8); return ByteOrderValues.getLong(buf8, byteOrder); }
@Override public InputStream getInputStream() throws IOException { PushbackInputStream pbis; try { pbis = new PushbackInputStream(b.getBinaryStream(), 9); } catch (SQLException e) { throw new IOException(e); } int byteOrder = pbis.read(); if (byteOrder == -1) { return pbis; } byte[] typeInt = new byte[4]; int bytesRead = pbis.read(typeInt); if (bytesRead == 4) { int srid = geometry.getSrid(); byte[] sridInt = new byte[4]; ByteOrderValues.putInt(srid, sridInt, byteOrder==0?ByteOrderValues.BIG_ENDIAN:ByteOrderValues.LITTLE_ENDIAN); pbis.unread(sridInt); typeInt[byteOrder==0?0:3] |= 0x20; } pbis.unread(typeInt, 0, bytesRead); pbis.unread(byteOrder); return pbis; } });
@Override public InputStream getInputStream() throws IOException { PushbackInputStream pbis; try { pbis = new PushbackInputStream(b.getBinaryStream(), 9); } catch (SQLException e) { throw new IOException(e); } int byteOrder = pbis.read(); if (byteOrder == -1) { return pbis; } byte[] typeInt = new byte[4]; int bytesRead = pbis.read(typeInt); if (bytesRead == 4) { int srid = geometry.getSrid(); byte[] sridInt = new byte[4]; ByteOrderValues.putInt(srid, sridInt, byteOrder==0?ByteOrderValues.BIG_ENDIAN:ByteOrderValues.LITTLE_ENDIAN); pbis.unread(sridInt); typeInt[byteOrder==0?0:3] |= 0x20; } pbis.unread(typeInt, 0, bytesRead); pbis.unread(byteOrder); return pbis; } });
@Override public InputStream getInputStream() throws IOException { PushbackInputStream pbis; try { pbis = new PushbackInputStream(b.getBinaryStream(), 9); } catch (SQLException e) { throw new IOException(e); } int byteOrder = pbis.read(); if (byteOrder == -1) { return pbis; } byte[] typeInt = new byte[4]; int bytesRead = pbis.read(typeInt); if (bytesRead == 4) { int srid = geometry.getSrid(); byte[] sridInt = new byte[4]; ByteOrderValues.putInt(srid, sridInt, byteOrder==0?ByteOrderValues.BIG_ENDIAN:ByteOrderValues.LITTLE_ENDIAN); pbis.unread(sridInt); typeInt[byteOrder==0?0:3] |= 0x20; } pbis.unread(typeInt, 0, bytesRead); pbis.unread(byteOrder); return pbis; } });