| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/io.R |
| 3 |
\name{read_bin} |
| 4 |
\alias{read_bin} |
| 5 |
\title{Read all records of a binary file as a raw vector by default} |
| 6 |
\usage{ |
| 7 |
read_bin(file, what = "raw", n = file.info(file)$size, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{file, what, n, ...}{Arguments to be passed to \code{readBin()}.} |
| 11 |
} |
| 12 |
\value{ |
| 13 |
A vector returned from \code{readBin()}. |
| 14 |
} |
| 15 |
\description{ |
| 16 |
This is a wrapper function of \code{\link[=readBin]{readBin()}} with default arguments |
| 17 |
\code{what = "raw"} and \verb{n = }\code{\link{file.size}}\code{(file)}, which means it |
| 18 |
will read the full content of a binary file as a raw vector by default. |
| 19 |
} |
| 20 |
\examples{ |
| 21 |
f = tempfile() |
| 22 |
cat("abc", file = f) |
| 23 |
xfun::read_bin(f) |
| 24 |
unlink(f) |
| 25 |
} |