Thread: StreamBuffer Conversion wL -> RuneSource

Page 1 of 9 123 ... LastLast
Results 1 to 10 of 84
  1. #1 StreamBuffer Conversion wL -> RuneSource 
    Registered Member

    Join Date
    Mar 2010
    Age
    29
    Posts
    686
    Thanks given
    35
    Thanks received
    92
    Rep Power
    157
    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:
    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)
    Writing:
    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)
    If I missed any conversions, or made a mistake anywhere, don't hesitate to tell me.
    Reply With Quote  
     


  2. #2  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    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:
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member

    Join Date
    Mar 2010
    Age
    29
    Posts
    686
    Thanks given
    35
    Thanks received
    92
    Rep Power
    157
    The Reading was for the client.
    Reply With Quote  
     

  5. #4  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    Quote Originally Posted by I Vain I View Post
    The Reading was for the client.
    wat the hell is that supposed to mean
    Reply With Quote  
     

  6. #5  
    brb ridin da storm

    blakeman8192's Avatar
    Join Date
    Dec 2012
    Age
    31
    Posts
    2,012
    Thanks given
    818
    Thanks received
    1,361
    Rep Power
    329
    Quote Originally Posted by filth View Post
    it's a buffer, you're not reading anything
    Don't be stupid, you read from a buffer like you read from a book.
    Code:
    v. read (rd), read*ing, reads
    v.tr.
    1. To examine and grasp the meaning of (written or printed characters, words, or sentences).
    Quote Originally Posted by filth View Post
    also the method names are even longer and more retarded than the original obfuscated versions :trollface:
    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.
    rest in peace Qemist, Izzy, Colton, TeChNo PuNk, Impulser, & bootnecklad
    Reply With Quote  
     


  7. #6  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    While we're on the subject, what does A, C and S actually stand for? I've always wondered.
    ~iKilem
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    Quote Originally Posted by blakeman8192 View Post
    Don't be stupid, you read from a buffer like you read from a book.
    Code:
    v. read (rd), read*ing, reads
    v.tr.
    1. To examine and grasp the meaning of (written or printed characters, words, or sentences).

    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.
    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)
    Reply With Quote  
     

  9. #8  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    Quote Originally Posted by filth View Post
    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.
    ~iKilem
    Reply With Quote  
     

  10. #9  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    Quote Originally Posted by iKilem View Post
    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
    Reply With Quote  
     

  11. #10  
    Registered Member

    Join Date
    Mar 2010
    Age
    29
    Posts
    686
    Thanks given
    35
    Thanks received
    92
    Rep Power
    157
    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.
    Reply With Quote  
     

  12. Thankful user:


Page 1 of 9 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [RuneSource]StreamBuffer: Useful conversions
    By AlexMason in forum Snippets
    Replies: 13
    Last Post: 03-02-2011, 01:51 AM
  2. runesource 503
    By Teemuzz in forum Buying
    Replies: 5
    Last Post: 02-24-2011, 04:50 PM
  3. Help with RuneSource.
    By strongbow in forum Help
    Replies: 0
    Last Post: 01-01-2011, 02:53 PM
  4. RuneSource.
    By sadgrills in forum Help
    Replies: 0
    Last Post: 12-31-2010, 01:23 AM
  5. [613+] RuneSource [613+]
    By vtothef in forum Projects
    Replies: 4
    Last Post: 10-29-2010, 06:16 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •