public void run() { memory.read(0, bl.unsafeBytes(), bl.begin(), len); } });
public void run() { memory.read(0, bl.unsafeBytes(), bl.begin(), strlen); } });
ourSharedMemory.read(0, buffer, 0, rc);
ourSharedMemory.read(0, buffer, 0, rc);
Memory memory = new Memory(40); PointerByReference data = new PointerByReference(); data.setValue(memory); // call the function now byte[] bytes = new byte[40]; memory.read(0, bytes, 0, 40);
private byte[] mpzExport(mpz_t ptr, int requiredSize) { ensureBufferSize(requiredSize); __gmpz_export(scratchBuf, countPtr, 1, 1, 1, 0, ptr); int count = readSizeT(countPtr); byte[] result = new byte[count]; scratchBuf.read(0, result, 0, count); return result; }
private byte[] mpzExport(mpz_t ptr, int requiredSize) { ensureBufferSize(requiredSize); __gmpz_export(scratchBuf, countPtr, 1, 1, 1, 0, ptr); int count = readSizeT(countPtr); byte[] result = new byte[count]; scratchBuf.read(0, result, 0, count); return result; }
private static String resolveSymlink(File link) throws IOException { String filename = link.getAbsolutePath(); for (int sz=512; sz < 65536; sz*=2) { Memory m = new Memory(sz); int r = LIBC.readlink(filename,m,new NativeLong(sz)); if (r<0) { int err = Native.getLastError(); if (err==22/*EINVAL --- but is this really portable?*/) return null; // this means it's not a symlink throw new IOException("Failed to readlink "+link+" error="+ err+" "+ LIBC.strerror(err)); } if (r==sz) continue; // buffer too small byte[] buf = new byte[r]; m.read(0,buf,0,r); return new String(buf); } throw new IOException("Failed to readlink "+link); }
private static String resolveSymlink(File link) throws IOException { String filename = link.getAbsolutePath(); for (int sz=512; sz < 65536; sz*=2) { Memory m = new Memory(sz); int r = LIBC.readlink(filename,m,new NativeLong(sz)); if (r<0) { int err = Native.getLastError(); if (err==22/*EINVAL --- but is this really portable?*/) return null; // this means it's not a symlink throw new IOException("Failed to readlink "+link+" error="+ err+" "+ LIBC.strerror(err)); } if (r==sz) continue; // buffer too small byte[] buf = new byte[r]; m.read(0,buf,0,r); return new String(buf); } throw new IOException("Failed to readlink "+link); }
m.read(0,buf,0,r); return new String(buf);
m.read(0,buf,0,r); return new String(buf);
m.read(0, buf, 0, r); return new String(buf);
return -1; readBuffer.read(0, buf, off, actual); return actual; } finally {
byte reportID = m_InputReportMemory.getByte(0); m_InputReportBytesRead[0]--; m_InputReportMemory.read(1, m_InputReportBytes, 0, m_InputReportBytesRead[0]);
port.m_RdBuffer.read(0, buffer, 0, port.m_RdN[0]); return port.m_RdN[0]; } catch (Fail ie) {
port.m_RdBuffer.read(0, buffer, 0, port.m_RdN[0]); return port.m_RdN[0]; } catch (Fail ie) {
port.m_RdBuffer.read(0, buffer, 0, port.m_RdN[0]); return port.m_RdN[0]; } catch (Fail ie) {