|
Well, some people may have trouble using the StreamBuffer in RuneSource, as they got used to WinterLove's Stream variables, so here's a simple conversion.
Reading:
Writing:stream.readSignedByte() = StreamBuffer.InBuffer.readByte()
stream.readSignedByteA() = StreamBuffer.InBuffer.readByte(ValueType.A)
stream.readSignedByteC() = StreamBuffer.InBuffer.readByte(ValueType.C)
stream.readSignedByteS() = StreamBuffer.InBuffer.readByte(ValueType.S)
stream.readUnsignedByte() = StreamBuffer.InBuffer.readByte(false)
stream.readUnsignedByteA() = StreamBuffer.InBuffer.readByte(false, ValueType.A)
stream.readUnsignedByteC() = StreamBuffer.InBuffer.readByte(false, ValueType.C)
stream.readUnsignedByteS() = StreamBuffer.InBuffer.readByte(false, ValueType.S)
stream.readSignedWord() = StreamBuffer.InBuffer.readShort()
stream.readSignedWordA() = StreamBuffer.InBuffer.readShort(ValueType.A)
stream.readSignedWordBigEndian() = StreamBuffer.InBuffer.readShort(ByteOrder.LITTLE)
stream.readSignedWordBigEndianA() = StreamBuffer.InBuffer.readShort(ValueType.A, ByteOrder.LITTLE)
stream.readUnsignedWord() = StreamBuffer.InBuffer.readShort(false)
stream.readUnsignedWordA() = StreamBuffer.InBuffer.readShort(false, ValueType.A)
stream.readUnsignedWordBigEndian() = StreamBuffer.InBuffer.readShort(false, ByteOrder.LITTLE)
stream.readUnsignedWordBigEndianA() = StreamBuffer.InBuffer.readShort(false, ValueType.A, ByteOrder.LITTLE)
stream.readDWord() = StreamBuffer.InBuffer.readInt()
stream.readDWord_v1() = StreamBuffer.InBuffer.readInt(ByteOrder.MIDDLE)
stream.readDWord_v2() = StreamBuffer.InBuffer.readInt(ByteOrder.INVERSE_MI DDLE)
stream.readQWord() = StreamBuffer.InBuffer.readLong()
stream.readString() = StreamBuffer.InBuffer.readString()
stream.readBytes(byte, x, y) = StreamBuffer.InBuffer.readBytes(int, x)
stream.readBytes_reverse(byte, x, y) = StreamBuffer.InBuffer.readBytesReverse(int, x, ValueType.STANDARD)
If I missed any conversions, or made a mistake anywhere, don't hesitate to tell me.stream.writeByte(int) = StreamBuffer.OutBuffer.writeByte(int)
stream.writeByteA(int) = StreamBuffer.OutBuffer.writeByte(int, ValueType.A)
stream.writeByteS(int) = StreamBuffer.OutBuffer.writeByte(int, ValueType.S)
stream.writeByteC(int) = StreamBuffer.OutBuffer.writeByte(int, ValueType.C)
stream.writeWord(int) = StreamBuffer.OutBuffer.writeShort(int)
stream.writeWordA(int) = StreamBuffer.OutBuffer.writeShort(int, ValueType.A)
stream.writeWordBigEndian(int) = StreamBuffer.OutBuffer.writeShort(int, ByteOrder.LITTLE)
stream.writeWordBigEndian_dup(int) = StreamBuffer.OutBuffer.writeShort(int, ByteOrder.LITTLE)
stream.writeWordBigEndianA(int) = StreamBuffer.OutBuffer.writeShort(int, ValueType.A, ByteOrder.LITTLE)
stream.writeDWord(int) = StreamBuffer.OutBuffer.writeInt(int)
stream.writeDWord_v1(int) = StreamBuffer.OutBuffer.writeInt(int, ByteOrder.MIDDLE)
stream.writeDWord_v2(int) = StreamBuffer.OutBuffer.writeInt(int, ByteOrder.INVERSE_MIDDLE)
stream.writeDWordBigEndian(int) = StreamBuffer.OutBuffer.writeInt(int, ByteOrder.LITTLE)
stream.writeQWord(int) = StreamBuffer.OutBuffer.writeLong(int)
stream.writeString(String) = StreamBuffer.OutBuffer.writeString(String)
stream.writeBytes(byte, x, y) = StreamBuffer.OutBuffer.writeBytes(ByteBuffer)
stream.writeBytes_reverseA(byte, x, y) = null
stream.createFrame(int) = StreamBuffer.OutBuffer.writeHeader(ISAACCipher, int)
stream.writeFrameSize(int) = StreamBuffer.OutBuffer.writeVariablePacketHeader(I SAACCipher, int)
stream.writeFrameSizeWord(int) = StreamBuffer.OutBuffer.writeVariableShortPacketHea der(ISAACCipher, int)
stream.initBitAccess() = StreamBuffer.OutBuffer.switchAccessType(AccessType .BIT_ACCESS)
stream.writeBits(int, int) = StreamBuffer.OutBuffer.writeBits(int, int)
stream.finishBitAccess() = StreamBuffer.OutBuffer.switchAccessType(AccessType .BYTE_ACCESS)
it's a buffer, you're not reading anything
also the method names are even longer and more retarded than the original obfuscated versions :trollface:
The Reading was for the client.
Don't be stupid, you read from a buffer like you read from a book.
The method naming is more accurate and actually representative of the function that the method provides. You're implying that longer (i.e. more informative) means worse, when in fact the contrary is most often seen to be true. There's a reason why, although Java follows a similar syntax to C, does not use tons of shorthand acronyms that need to be memorized like C does - it's a pain in the ass to remember it all.Code:v. read (rd), read*ing, reads v.tr. 1. To examine and grasp the meaning of (written or printed characters, words, or sentences).
While we're on the subject, what does A, C and S actually stand for? I've always wondered.
you're thinking out of context, obviously by read i meant the standard use for read in java, as in what Sun names them?? read is used in conjunction with reading from a stream, get is used in conjunction with reading data from a buffer, i guess you don't see the difference though
and how the hell are your methods more representative because their longer? it is exactly the same except your names are longer? is it supposed to be easier because instead of writeByteA() you can use writeByte(ValueType.A)?? i don't particularly see the difference there bro. speaking of ValueTypes... what the HELL is a ValueType rofl what kind of retarded name is that, i think you just mean Type, it's implied that it has a value? also let me let you in on a secret, A, C, S mean nothing, you should probably change those unless you rely on winterLove for naming things...
@iKilem
they don't mean anything, whoever named them is an idiot. I gave them my own names, i.e. putNByte (put a negative byte)
The Java API isn't law. Hell, it isn't even consistent nor does some of the naming make sense. Just ignore Java's naming. Is "read" actually inaccurate? Personally, I prefer it to "get", because you're not simply retrieving a value; the buffer is like a user-defined stream that has an offset, which increases everytime you "read" a byte.
Surely the author must've associated those letters with something. I think "A" just stands for add and "S" stands for subtract, which would make sense. Can't make sense of "C", though.
in the case of buffers and inputstreams i think read and get are very important since this is one law that is consistent and there is a big difference.
and i'd personally call them something around varied signed and unsigned bytes since that is the result, but it doesn't store them as the exact value they represent, and not to confuse them with actual signed and unsigned bytes (and C i call a negative byte, because it is a byte that is made negative :trollface
Filth, what are you on about?
@iKillem, you're right.
ValueType is an enum of four different values. A being to add 128 to the value, S being to subtract 128 from the value, C being to invert the value, and STANDARD being the normal value.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |