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:
Closeable,Flushable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe position within the file that we will write to next.private byte[]A temporary buffer that can be used for larger writes.private byte[]A buffer of 0s to use for writing alignment valuesFields inherited from class java.io.BufferedOutputStream
buf, countFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionDexDataWriter(OutputStream output, int filePosition) Construct a new DexWriter instance that writes to output.DexDataWriter(OutputStream output, int filePosition, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidalign()intvoidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteEncodedDouble(int valueType, double value) voidwriteEncodedFloat(int valueType, float value) voidwriteEncodedInt(int valueType, int value) voidwriteEncodedLong(int valueType, long value) voidwriteEncodedUint(int valueType, int value) voidwriteEncodedValueHeader(int valueType, int valueArg) voidwriteInt(int value) static voidwriteInt(OutputStream out, int value) voidwriteLong(long value) protected voidwriteRightZeroExtendedInt(int valueType, int value) protected voidwriteRightZeroExtendedLong(int valueType, long value) voidwriteShort(int value) voidwriteSleb128(int value) static voidwriteSleb128(OutputStream out, int value) voidwriteString(String string) voidwriteUbyte(int value) voidwriteUleb128(int value) static voidwriteUleb128(OutputStream out, int value) voidwriteUshort(int value) Methods inherited from class java.io.BufferedOutputStream
flushMethods inherited from class java.io.FilterOutputStream
closeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
filePosition
private int filePositionThe position within the file that we will write to next. This is only updated when the buffer is flushed to the outputStream. -
tempBuf
private byte[] tempBufA temporary buffer that can be used for larger writes. Can be replaced with a larger buffer if needed. Must be at least 8 bytes -
zeroBuf
private byte[] zeroBufA buffer of 0s to use for writing alignment values
-
-
Constructor Details
-
DexDataWriter
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
-
-
Method Details
-
write
- Overrides:
writein classBufferedOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classBufferedOutputStream- Throws:
IOException
-
writeLong
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeShort
- Throws:
IOException
-
writeUshort
- Throws:
IOException
-
writeUbyte
- Throws:
IOException
-
writeUleb128
- Throws:
IOException
-
writeUleb128
- Throws:
IOException
-
writeSleb128
- Throws:
IOException
-
writeSleb128
- Throws:
IOException
-
writeEncodedValueHeader
- Throws:
IOException
-
writeEncodedInt
- Throws:
IOException
-
writeEncodedLong
- Throws:
IOException
-
writeEncodedUint
- Throws:
IOException
-
writeEncodedFloat
- Throws:
IOException
-
writeRightZeroExtendedInt
- Throws:
IOException
-
writeEncodedDouble
- Throws:
IOException
-
writeRightZeroExtendedLong
- Throws:
IOException
-
writeString
- Throws:
IOException
-
align
- Throws:
IOException
-
getPosition
public int getPosition()
-