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 17 package com.android.dx.io.instructions; 18 19 /** 20 * Output stream of code units, for writing out Dalvik bytecode. 21 */ 22 public interface CodeOutput extends CodeCursor { 23 /** 24 * Writes a code unit. 25 */ write(short codeUnit)26 public void write(short codeUnit); 27 28 /** 29 * Writes two code units. 30 */ write(short u0, short u1)31 public void write(short u0, short u1); 32 33 /** 34 * Writes three code units. 35 */ write(short u0, short u1, short u2)36 public void write(short u0, short u1, short u2); 37 38 /** 39 * Writes four code units. 40 */ write(short u0, short u1, short u2, short u3)41 public void write(short u0, short u1, short u2, short u3); 42 43 /** 44 * Writes five code units. 45 */ write(short u0, short u1, short u2, short u3, short u4)46 public void write(short u0, short u1, short u2, short u3, short u4); 47 48 /** 49 * Writes an {@code int}, little-endian. 50 */ writeInt(int value)51 public void writeInt(int value); 52 53 /** 54 * Writes a {@code long}, little-endian. 55 */ writeLong(long value)56 public void writeLong(long value); 57 58 /** 59 * Writes the contents of the given array. 60 */ write(byte[] data)61 public void write(byte[] data); 62 63 /** 64 * Writes the contents of the given array. 65 */ write(short[] data)66 public void write(short[] data); 67 68 /** 69 * Writes the contents of the given array. 70 */ write(int[] data)71 public void write(int[] data); 72 73 /** 74 * Writes the contents of the given array. 75 */ write(long[] data)76 public void write(long[] data); 77 } 78