Android Utililty Methods ByteArrayOutputStream Write

List of utility methods to do ByteArrayOutputStream Write

Description

The list of methods to do ByteArrayOutputStream Write are organized into topic(s).

Method

voidwriteUint32BE(ByteArrayOutputStream buffer, long value)
write Uint BE
buffer.write((byte) ((value >> 24) & 0xff));
buffer.write((byte) ((value >> 16) & 0xff));
buffer.write((byte) ((value >> 8) & 0xff));
buffer.write((byte) (value & 0xff));
voidwriteUint32LE(ByteArrayOutputStream buffer, long value)
write Uint LE
buffer.write((byte) (value & 0xff));
buffer.write((byte) ((value >> 8) & 0xff));
buffer.write((byte) ((value >> 16) & 0xff));
buffer.write((byte) ((value >> 24) & 0xff));
voidwriteUint64BE(ByteArrayOutputStream buffer, long value)
write Uint BE
buffer.write((byte) ((value >> 56) & 0xff));
buffer.write((byte) ((value >> 48) & 0xff));
buffer.write((byte) ((value >> 40) & 0xff));
buffer.write((byte) ((value >> 32) & 0xff));
buffer.write((byte) ((value >> 24) & 0xff));
buffer.write((byte) ((value >> 16) & 0xff));
buffer.write((byte) ((value >> 8) & 0xff));
buffer.write((byte) (value & 0xff));
...
voidwriteUint64LE(ByteArrayOutputStream buffer, long value)
write Uint LE
buffer.write((byte) (value & 0xff));
buffer.write((byte) ((value >> 8) & 0xff));
buffer.write((byte) ((value >> 16) & 0xff));
buffer.write((byte) ((value >> 24) & 0xff));
buffer.write((byte) ((value >> 32) & 0xff));
buffer.write((byte) ((value >> 40) & 0xff));
buffer.write((byte) ((value >> 48) & 0xff));
buffer.write((byte) ((value >> 56) & 0xff));
...
voidcopyTo(Context context, String fromPath, String toFile)
copy To
try {
    if (!new File(toFile).exists()) {
        new File(toFile).createNewFile();
    InputStream fromFileIs = context.getResources().getAssets()
            .open(fromPath);
    int length = fromFileIs.available();
    byte[] buffer = new byte[length];
...
voidwriteInt(ByteArrayOutputStream baos, int i)
write Int
for (int j = 0; j < 4; j++) {
    int shift = 24 - j * 8;
    baos.write((byte) (i >>> shift));
voidcopyStream(ByteArrayOutputStream source, ByteArrayOutputStream target)
Copies source stream to target.
    ByteArrayOutputStream memContentStream = source;
    if (memContentStream != null) {
        memContentStream.writeTo(target);
        memContentStream.flush();
    } else {
        int c;
        ByteArrayInputStream inStream = new ByteArrayInputStream(
                source.toByteArray());
...