Gets the bytes.

@param i the i
@param j the j
@return the bytes
970215
public int getBytesBigEndian(int i, int j) {
    int result = 0;
    for (int k = i; k < i + j; k++) {
      result += value.get(k).toUint();
      if (k + 1 < i + j)
        result <<= 8;
    }
    return result;
  }
413668
@Override
    public byte[] getBytes(int position, int length) {
        byte[] result = new byte[length];
        for (int i = 0; i < length; i++) {
            result[i]=getByte(position);
            position += BYTE_LEN;
        }
        return result;
    }
555411
private ByteBuf buffer(int i) {
        ByteBuf b = buffers[i];
        return b instanceof Component ? ((Component) b).buf : b;
    }
735815
public static byte[] toByteArray(final int i)
        {
        final byte[] b = new byte[4];

        b[0] = (byte) ((i & 0xff000000) >>> 24);
        b[1] = (byte) ((i & 0x00ff0000) >>> 16);
        b[2] = (byte) ((i & 0x0000ff00) >>> 8);
        b[3] = (byte) ((i & 0x000000ff));

        return b;
        }
540539
private byte getByte(int index) {
        if (index < initialSize) {
            return pool.get(0)[index];
        }
        
        index -= initialSize;
        return pool.get(index / incrementalSize + 1)[index % incrementalSize];
    }
435182
public static byte[] getBytes(File file) throws IOException {
		InputStream in = new FileInputStream(file);
		int fileSize = (int) file.length();

		if (fileSize > Integer.MAX_VALUE) {
			in.close();
			throw new IOException("File size to large: " + fileSize + " > " + Integer.MAX_VALUE);
		}

		byte[] bytes = new byte[fileSize];

		// Read in the bytes
		int offset = 0;
		int numRead = 0;
		while (offset < bytes.length && (numRead = in.read(bytes, offset, bytes.length-offset)) >= 0) {
			offset += numRead;
		}

		// Ensure all the bytes have been read in
		if (offset < bytes.length) {
			in.close();
			throw new IOException("Could not completely read file " + file.getName());
		}

		in.close();

		return bytes;
	}
584721
public static byte[] integer_to_bytes(int i) {
		final byte[] b = new byte[4];
		b[0] = (byte) (i & 0xff);
		i >>= 8;
		b[1] = (byte) (i & 0xff);
		i >>= 8;
		b[2] = (byte) (i & 0xff);
		i >>= 8;
		b[3] = (byte) (i & 0xff);
		return b;
	}
1203733
private static byte[] convertToBytes(int i) {
        int size = (int)Math.floor(Math.log(i) / Math.log(10));
        if (i % 100 != 0) {
            size += 2;
        }
        if (i % 10 != 0) {
            size++;
        }
        if (i < 100) {
            size++;
            if (i < 10) {
                size++;
            }
        }
        size--;
        byte[] cache = new byte[size];
        size --;
        if (i < 100) {
            cache[0] = (byte)'0';
        }
        if (i % 10 != 0) {
            cache[size--] = bytes[i % 10];
        }
        if (i % 100 != 0) {
            cache[size--] = bytes[(i / 10) % 10];
            cache[size--] = (byte)'.';
        }
        size = (int)Math.floor(Math.log(i) / Math.log(10)) - 1;
        int add = 0;
        while (add < size) {
            cache[add] = bytes[(i / (int)Math.pow(10, size - add + 1)) % 10];
            add++;
        }
        return cache;
    }
149146
private static byte[] getBytes(InputStream is) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        byte[] buf = new byte[4096];

        while (true) {
            int r = is.read(buf);
            if (r == -1) {
                out.flush();
                return out.toByteArray();
            }
            out.write(buf, 0, r);
        }
    }
248440
private int s2i(final byte[] bytes) {
    int num = 0;
    for (int i = 0; i < 4; i++) {
      num += (bytes[i] & 0xff) << ((3 - i) * 8);
    }
    return num;
  }
844625
public static byte[] bytes(InputStream in) throws IOException {
        if(in == null)
            throw new IllegalArgumentException("input stream cannot be null");

        ByteArrayOutputStream bout = new ByteArrayOutputStream(1024);
        byte[] bytes = new byte[1024];

        for (int x = in.read(bytes); x != -1; x = in.read(bytes))
            bout.write(bytes, 0, x);

        return bout.toByteArray();
    }
368959
public static byte[] getBytes(Object obj) throws IOException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(bos);
		oos.writeObject(obj);
		oos.flush();
		oos.close();
		bos.close();
		byte[] data = bos.toByteArray();
		return data;
	}
20705
public static byte[] getBytes(URL url) throws IOException {
        final String path = url.getPath();
        final File file = new File(path);
        if (file.exists()) {
            return getFileBytes(file);
        }

        return null;
    }
295518
public static byte safeIntToByte(int i) {
        if (i > (int)Byte.MAX_VALUE || i < (int) Byte.MIN_VALUE) {
            throw new IllegalStateException("Cannot convert int to byte: " + i);
        }
        return (byte)i;
    }
1267329
@Override
    public Boolean get(int i) {
        byte b = data.getByte(i);
        if (b == BooleanColumnType.BYTE_TRUE) {
            return Boolean.TRUE;
        }
        if (b == BooleanColumnType.BYTE_FALSE) {
            return Boolean.FALSE;
        }
        return null;
    }
1181710
public String getFunction(int i) throws ArrayIndexOutOfBoundsException
  {

    if (null == m_functions)
      throw new ArrayIndexOutOfBoundsException();

    return (String) m_functions.elementAt(i);
  }
1047705
private byte readByte()
            throws IOException
    {
        if (buffer.size() > position) {
            byte b = buffer.getByte(position);
            position++;
            return b;
        }
        else {
            nextBuffer();
            if (buffer.size() > 0) {
                byte b = buffer.getByte(0);
                position = 1;
                return b;
            }
            return readByte();
        }
    }