Java ByteBuffer Read readNewLine(ByteBuffer buf)

Here you can find the source of readNewLine(ByteBuffer buf)

Description

read New Line

License

LGPL

Declaration

public static int readNewLine(ByteBuffer buf) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.nio.ByteBuffer;

public class Main {
    public static int readNewLine(ByteBuffer buf) {
        char ch;//from ww  w .  ja va2  s. co m
        int num = 0;

        while (buf.remaining() > 0) {
            ch = (char) buf.get();
            num++;
            if (ch == '\n')
                break;
        }
        return num;
    }
}

Related

  1. readIso639(ByteBuffer bb)
  2. readKatakana(ByteBuffer b, char s[], int off, int len)
  3. readLen(ByteBuffer dup, int nls)
  4. readLink(ByteBuffer bb)
  5. readLink(ByteBuffer bb)
  6. readNullTerminatedString(ByteBuffer buf)
  7. readObject(ByteBuffer byteBuffer)
  8. readReal(ByteBuffer bb)
  9. readResBit15(ByteBuffer fromBuffer)