Package org.jf.dexlib2.writer
Class DexDataWriter
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.BufferedOutputStream
-
- org.jf.dexlib2.writer.DexDataWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class DexDataWriter extends java.io.BufferedOutputStream
-
-
Constructor Summary
Constructors Constructor Description DexDataWriter(java.io.OutputStream output, int filePosition)
Construct a new DexWriter instance that writes to output.DexDataWriter(java.io.OutputStream output, int filePosition, int bufferSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
align()
int
getPosition()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
void
writeEncodedDouble(int valueType, double value)
void
writeEncodedFloat(int valueType, float value)
void
writeEncodedInt(int valueType, int value)
void
writeEncodedLong(int valueType, long value)
void
writeEncodedUint(int valueType, int value)
void
writeEncodedValueHeader(int valueType, int valueArg)
void
writeInt(int value)
static void
writeInt(java.io.OutputStream out, int value)
void
writeLong(long value)
protected void
writeRightZeroExtendedInt(int valueType, int value)
protected void
writeRightZeroExtendedLong(int valueType, long value)
void
writeShort(int value)
void
writeSleb128(int value)
static void
writeSleb128(java.io.OutputStream out, int value)
void
writeString(java.lang.String string)
void
writeUbyte(int value)
void
writeUleb128(int value)
static void
writeUleb128(java.io.OutputStream out, int value)
void
writeUshort(int value)
-
-
-
Constructor Detail
-
DexDataWriter
public DexDataWriter(@Nonnull java.io.OutputStream output, int filePosition)
Construct a new DexWriter instance that writes to output.- Parameters:
output
- An OutputStream to write the data to.filePosition
- The position within the file that OutputStream will write to.
-
DexDataWriter
public DexDataWriter(@Nonnull java.io.OutputStream output, int filePosition, int bufferSize)
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException
- Overrides:
write
in classjava.io.BufferedOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.BufferedOutputStream
- Throws:
java.io.IOException
-
writeLong
public void writeLong(long value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInt
public static void writeInt(java.io.OutputStream out, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInt
public void writeInt(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeShort
public void writeShort(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeUshort
public void writeUshort(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeUbyte
public void writeUbyte(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeUleb128
public static void writeUleb128(java.io.OutputStream out, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeUleb128
public void writeUleb128(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSleb128
public static void writeSleb128(java.io.OutputStream out, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSleb128
public void writeSleb128(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedValueHeader
public void writeEncodedValueHeader(int valueType, int valueArg) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedInt
public void writeEncodedInt(int valueType, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedLong
public void writeEncodedLong(int valueType, long value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedUint
public void writeEncodedUint(int valueType, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedFloat
public void writeEncodedFloat(int valueType, float value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeRightZeroExtendedInt
protected void writeRightZeroExtendedInt(int valueType, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEncodedDouble
public void writeEncodedDouble(int valueType, double value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeRightZeroExtendedLong
protected void writeRightZeroExtendedLong(int valueType, long value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeString
public void writeString(java.lang.String string) throws java.io.IOException
- Throws:
java.io.IOException
-
align
public void align() throws java.io.IOException
- Throws:
java.io.IOException
-
getPosition
public int getPosition()
-
-