/** * Creates a new stream based on the given buffer. * * @param buffer the bytes to read */ public ByteArrayInStream(final byte[] buffer) { setBytes(buffer); }
/** * Creates a new stream based on the given buffer. * * @param buffer the bytes to read */ public ByteArrayInStream(final byte[] buffer) { setBytes(buffer); }
/** * This method will convert a Well Known Binary representation to a * JTS Geometry object. * * @param wkb te wkb encoded byte array * * @return a JTS Geometry object that is equivalent to the WTB * representation passed in by param wkb * * @throws IOException if more than one geometry object was found in the * WTB representation, or if the parser could not parse the WKB * representation. */ private Geometry wkb2Geometry(byte[] wkbBytes) throws IOException { if (wkbBytes == null) //DJB: null value from database --> null geometry (the same behavior as WKT). NOTE: sending back a GEOMETRYCOLLECTION(EMPTY) is also a possibility, but this is not the same as NULL return null; try { inStream.setBytes(wkbBytes); return wkbr.read(inStream); } catch (Exception e) { throw new DataSourceException("An exception occurred while parsing WKB data", e); } }