@Override public void writeLong(long n) throws IOException { long val = (n << 1) ^ (n >> 63); // move sign to low-order bit if ((val & ~0x7FFFFFFFL) == 0) { int i = (int) val; while ((i & ~0x7F) != 0) { out.write((byte)((0x80 | i) & 0xFF)); i >>>= 7; } out.write((byte)i); return; } int len = BinaryData.encodeLong(n, buf, 0); out.write(buf, 0, len); }
@Override public void writeLong(long n) throws IOException { long val = (n << 1) ^ (n >> 63); // move sign to low-order bit if ((val & ~0x7FFFFFFFL) == 0) { int i = (int) val; while ((i & ~0x7F) != 0) { out.write((byte)((0x80 | i) & 0xFF)); i >>>= 7; } out.write((byte)i); return; } int len = BinaryData.encodeLong(n, buf, 0); out.write(buf, 0, len); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
corrupted = new byte[original.length]; System.arraycopy(original, 0, corrupted, 0, original.length); BinaryData.encodeLong(-1, corrupted, corruptPosition);
@Override public void writeLong(long n) throws IOException { long val = (n << 1) ^ (n >> 63); // move sign to low-order bit if ((val & ~0x7FFFFFFFL) == 0) { int i = (int) val; while ((i & ~0x7F) != 0) { out.write((byte)((0x80 | i) & 0xFF)); i >>>= 7; } out.write((byte)i); return; } int len = BinaryData.encodeLong(n, buf, 0); out.write(buf, 0, len); }
@Override public void writeLong(long n) throws IOException { long val = (n << 1) ^ (n >> 63); // move sign to low-order bit if ((val & ~0x7FFFFFFFL) == 0) { int i = (int) val; while ((i & ~0x7F) != 0) { out.write((byte)((0x80 | i) & 0xFF)); i >>>= 7; } out.write((byte)i); return; } int len = BinaryData.encodeLong(n, buf, 0); out.write(buf, 0, len); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }