public static float readFloatBig(ByteSequence packet) throws IOException { return Float.intBitsToFloat(readIntBig(packet)); }
protected byte[] decompress(ByteSequence dataSequence) throws IOException { Inflater inflater = new Inflater(); ByteArrayOutputStream decompressed = new ByteArrayOutputStream(); try { length = ByteSequenceData.readIntBig(dataSequence); dataSequence.offset = 0; byte[] data = Arrays.copyOfRange(dataSequence.getData(), 4, dataSequence.getLength()); inflater.setInput(data); byte[] buffer = new byte[length]; int count = inflater.inflate(buffer); decompressed.write(buffer, 0, count); return decompressed.toByteArray(); } catch (Exception e) { throw new IOException(e); } finally { inflater.end(); decompressed.close(); } }
public static float readFloatBig(ByteSequence packet) throws IOException { return Float.intBitsToFloat(readIntBig(packet)); }
public static float readFloatBig(ByteSequence packet) throws IOException { return Float.intBitsToFloat(readIntBig(packet)); }
public static float readFloatBig(ByteSequence packet) throws IOException { return Float.intBitsToFloat(readIntBig(packet)); }
public static float readFloatBig(ByteSequence packet) throws IOException { return Float.intBitsToFloat(readIntBig(packet)); }
private static ByteSequence writeCompressedBytesType(final ByteSequence contents) throws IOException { Inflater inflater = new Inflater(); try (org.apache.activemq.util.ByteArrayOutputStream decompressed = new org.apache.activemq.util.ByteArrayOutputStream()) { int length = ByteSequenceData.readIntBig(contents); contents.offset = 0; byte[] data = Arrays.copyOfRange(contents.getData(), 4, contents.getLength()); inflater.setInput(data); byte[] buffer = new byte[length]; int count = inflater.inflate(buffer); decompressed.write(buffer, 0, count); return decompressed.toByteSequence(); } catch (Exception e) { throw new IOException(e); } finally { inflater.end(); } }
protected byte[] decompress(ByteSequence dataSequence) throws IOException { Inflater inflater = new Inflater(); ByteArrayOutputStream decompressed = new ByteArrayOutputStream(); try { length = ByteSequenceData.readIntBig(dataSequence); dataSequence.offset = 0; byte[] data = Arrays.copyOfRange(dataSequence.getData(), 4, dataSequence.getLength()); inflater.setInput(data); byte[] buffer = new byte[length]; int count = inflater.inflate(buffer); decompressed.write(buffer, 0, count); return decompressed.toByteArray(); } catch (Exception e) { throw new IOException(e); } finally { inflater.end(); decompressed.close(); } }
protected byte[] decompress(ByteSequence dataSequence) throws IOException { Inflater inflater = new Inflater(); ByteArrayOutputStream decompressed = new ByteArrayOutputStream(); try { length = ByteSequenceData.readIntBig(dataSequence); dataSequence.offset = 0; byte[] data = Arrays.copyOfRange(dataSequence.getData(), 4, dataSequence.getLength()); inflater.setInput(data); byte[] buffer = new byte[length]; int count = inflater.inflate(buffer); decompressed.write(buffer, 0, count); return decompressed.toByteArray(); } catch (Exception e) { throw new IOException(e); } finally { inflater.end(); decompressed.close(); } }
protected byte[] decompress(ByteSequence dataSequence) throws IOException { Inflater inflater = new Inflater(); ByteArrayOutputStream decompressed = new ByteArrayOutputStream(); try { length = ByteSequenceData.readIntBig(dataSequence); dataSequence.offset = 0; byte[] data = Arrays.copyOfRange(dataSequence.getData(), 4, dataSequence.getLength()); inflater.setInput(data); byte[] buffer = new byte[length]; int count = inflater.inflate(buffer); decompressed.write(buffer, 0, count); return decompressed.toByteArray(); } catch (Exception e) { throw new IOException(e); } finally { inflater.end(); decompressed.close(); } }