CodeOutput.java revision 579d7739c53a2707ad711a2d2cae46d7d782f061
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.dx.io.instructions;
18
19/**
20 * Output stream of code units, for writing out Dalvik bytecode.
21 */
22public interface CodeOutput extends CodeCursor {
23    /**
24     * Writes a code unit.
25     */
26    public void write(short codeUnit);
27
28    /**
29     * Writes two code units.
30     */
31    public void write(short u0, short u1);
32
33    /**
34     * Writes three code units.
35     */
36    public void write(short u0, short u1, short u2);
37
38    /**
39     * Writes four code units.
40     */
41    public void write(short u0, short u1, short u2, short u3);
42
43    /**
44     * Writes five code units.
45     */
46    public void write(short u0, short u1, short u2, short u3, short u4);
47
48    /**
49     * Writes an {@code int}, little-endian.
50     */
51    public void writeInt(int value);
52
53    /**
54     * Writes a {@code long}, little-endian.
55     */
56    public void writeLong(long value);
57
58    /**
59     * Writes the contents of the given array.
60     */
61    public void write(byte[] data);
62
63    /**
64     * Writes the contents of the given array.
65     */
66    public void write(short[] data);
67
68    /**
69     * Writes the contents of the given array.
70     */
71    public void write(int[] data);
72
73    /**
74     * Writes the contents of the given array.
75     */
76    public void write(long[] data);
77}
78