@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); byte[] bytes = new byte[getNBytes()]; for(int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) { if (bitIndex == 8) { bitIndex = 0; byteIndex++; } if (bitIndex == 0) { bytes[byteIndex] = 0; } if (bits.get(i)) { bytes[byteIndex] |= bitvalues[bitIndex]; } } out.write(bytes); }
public static String WriteBloomToString(Filter bloom) throws IOException { if (bloom != null) { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); bloom.write(new DataOutputStream(buffer)); byte[] encodedBloom = Base64.encodeBase64(buffer.toByteArray()); return new String(encodedBloom); } else { return null; } }
@Override public void write(DataOutput out) throws IOException { super.write(out); int byteSize = getNBytes(); LOG.info(" Number of bytes = " + getNBytes() + " vector size = " + super.vectorSize); if (getNBytes() < 0) { LOG.error(" Byte array size is less than zero !!!"); byteSize = byteSize * -1; } ///byte[] bytes = new byte[getNBytes()]; byte[] bytes = new byte[byteSize]; for (int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) { if (bitIndex == 8) { bitIndex = 0; byteIndex++; } if (bitIndex == 0) { bytes[byteIndex] = 0; } if (bits.get(i)) { bytes[byteIndex] |= bitvalues[bitIndex]; } } out.write(bytes); }
@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(nr); out.writeInt(currentNbRecord); out.writeInt(matrix.length); for (int i = 0; i < matrix.length; i++) { matrix[i].write(out); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); int sizeInWords = buckets2words(vectorSize); for(int i = 0; i < sizeInWords; i++) { out.writeLong(buckets[i]); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); byte[] bytes = new byte[getNBytes()]; for(int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) { if (bitIndex == 8) { bitIndex = 0; byteIndex++; } if (bitIndex == 0) { bytes[byteIndex] = 0; } if (bits.get(i)) { bytes[byteIndex] |= bitvalues[bitIndex]; } } out.write(bytes); }
@Override public void write(DataOutput out) throws IOException { super.write(out); byte[] bytes = new byte[getNBytes()]; for(int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) { if (bitIndex == 8) { bitIndex = 0; byteIndex++; } if (bitIndex == 0) { bytes[byteIndex] = 0; } if (bits.get(i)) { bytes[byteIndex] |= bitvalues[bitIndex]; } } out.write(bytes); }
@Override public void write(DataOutput out) throws IOException { super.write(out); byte[] bytes = new byte[getNBytes()]; for(int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) { if (bitIndex == 8) { bitIndex = 0; byteIndex++; } if (bitIndex == 0) { bytes[byteIndex] = 0; } if (bits.get(i)) { bytes[byteIndex] |= bitvalues[bitIndex]; } } out.write(bytes); }
@Nonnull public static byte[] serialize(@Nonnull final Filter filter) throws IOException { FastByteArrayOutputStream bos = new FastByteArrayOutputStream(); Base91OutputStream base91 = new Base91OutputStream(bos); DataOutputStream out = new DataOutputStream(base91); filter.write(out); out.flush(); base91.finish(); return bos.toByteArray(); }
@Nonnull public static Text serialize(@Nonnull final Filter filter, @Nonnull final Text dst) throws IOException { FastByteArrayOutputStream bos = new FastByteArrayOutputStream(); Base91OutputStream base91 = new Base91OutputStream(bos); DataOutputStream out = new DataOutputStream(base91); filter.write(out); out.flush(); base91.finish(); dst.set(bos.getInternalArray(), 0, bos.size()); return dst; }